fn write_avro_datum<T: ToAvro>(
    schema: &Schema,
    value: T,
    buffer: &mut Vec<u8>,
) -> Result<(), Error> {
    let avro = value.avro();
    if !avro.validate(schema) {
        return Err(ValidationError::new("value does not match schema").into());
    }
    encode(&avro, schema, buffer);
    Ok(())
}
/// Encode a compatible value (implementing the `ToAvro` trait) into Avro format, also performing
/// schema validation.
///
/// This is an internal function which gets the bytes buffer where to write as parameter instead of
/// creating a new one like `to_avro_datum`.
Encode a compatible value (implementing the `ToAvro` trait) into Avro format, also performing
schema validation.

This is an internal function which gets the bytes buffer where to write as parameter instead of
creating a new one like `to_avro_datum`.
Encode a compatible value ( implementing the ` ToAvro ` trait ) into Avro format also performing schema validation . This is an internal function which gets the bytes buffer where to write as parameter instead of creating a new one like ` to_avro_datum ` .
fn write_avro_datum<T: ToAvro>(
    schema: &Schema,
    value: T,
    buffer: &mut Vec<u8>,
) -> Result<(), Error> {
    let avro = value.avro();
    if !avro.validate(schema) {
        return Err(ValidationError::new("value does not match schema").into());
    }
    encode(&avro, schema, buffer);
    Ok(())
}
fn write_avro_datum < T : ToAvro > ( schema : & Schema , value : T , buffer : & mut Vec < u8 > , ) -> Result < ( ) , Error > { let avro = value . avro ( ) ; if ! avro . validate ( schema ) { return Err ( ValidationError :: new ( " " ) . into ( ) ) ; } encode ( & avro , schema , buffer ) ; Ok ( ( ) ) }
Encode a compatible value (implementing the `ToAvro` trait) into Avro format, also performing
schema validation.
Encode a compatible value ( implementing the ` ToAvro ` trait ) into Avro format also performing schema validation .
schema
&Schema
value
T
buffer
&mut Vec<u8>