function amfXEncodeOne(rules, o) {
  //    logger.debug('amfXEncodeOne type',o,amfType(o),rules[amfType(o)]);
  let f = rules[amfType(o)];
  if (f) return f(o);
  throw new Error("Unsupported type for encoding!");
}
Encode one AMF value according to rules
@param {Array} rules
@param {object} o
@returns {*}