Function mz_avro::to_avro_datum

source ·
pub fn to_avro_datum<T: ToAvro>(
    schema: &Schema,
    value: T
) -> Result<Vec<u8>, Error>
Expand description

Encode a compatible value (implementing the ToAvro trait) into Avro format, also performing schema validation.

NOTE This function has a quite small niche of usage and does NOT generate headers and sync markers; use Writer to be fully Avro-compatible if you don’t know what you are doing, instead.