pub fn encode_datums_as_avro<'a, I>(datums: I, names_types: &[(ColumnName, ColumnType)]) -> Value
where
    I: IntoIterator<Item = Datum<'a>>,
{
    let value_fields: Vec<(String, Value)> = names_types
        .iter()
        .zip_eq(datums)
        .map(|((name, typ), datum)| {
            let name = name.as_str().to_owned();
            use mz_avro::types::ToAvro;
            (name, TypedDatum::new(datum, typ.clone()).avro())
        })
        .collect();
    let v = Value::Record(value_fields);
    v
}
/// Encodes a sequence of `Datum` as Avro (key and value), using supplied column names and types.
Encodes a sequence of `Datum` as Avro (key and value), using supplied column names and types.
Encodes a sequence of ` Datum ` as Avro ( key and value ) using supplied column names and types .
pub fn encode_datums_as_avro<'a, I>(datums: I, names_types: &[(ColumnName, ColumnType)]) -> Value
where
    I: IntoIterator<Item = Datum<'a>>,
{
    let value_fields: Vec<(String, Value)> = names_types
        .iter()
        .zip_eq(datums)
        .map(|((name, typ), datum)| {
            let name = name.as_str().to_owned();
            use mz_avro::types::ToAvro;
            (name, TypedDatum::new(datum, typ.clone()).avro())
        })
        .collect();
    let v = Value::Record(value_fields);
    v
}
pub fn encode_datums_as_avro < ' a , I > ( datums : I , names_types : & [ ( ColumnName , ColumnType ) ] ) -> Value where I : IntoIterator < Item = Datum < ' a > > , { let value_fields : Vec < ( String , Value ) > = names_types . iter ( ) . zip_eq ( datums ) . map ( | ( ( name , typ ) , datum ) | { let name = name . as_str ( ) . to_owned ( ) ; use mz_avro :: types :: ToAvro ; ( name , TypedDatum :: new ( datum , typ . clone ( ) ) . avro ( ) ) } ) . collect ( ) ; let v = Value :: Record ( value_fields ) ; v }
Encodes a sequence of `Datum` as Avro (key and value), using supplied column names and types.
Encodes a sequence of ` Datum ` as Avro ( key and value ) using supplied column names and types .
datums
I
names_types
&[(ColumnName, ColumnType)]
datums
I
names_types
&[(ColumnName, ColumnType)]