fn serialize_field_to_meta<S>(
    meta: &[FieldMeta; FIELDS_NUM],
    serializer: S,
) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    let mut map = FieldMetaMap(HashMap::new());
    for field in Fields::iterator() {
        map.0.insert(*field, meta[*field as usize].clone());
    }
    map.serialize(serializer)
}
// To make metadata easier to read, convert to json where fields are represented
// as strings with their names, not numbers in enum.
To make metadata easier to read, convert to json where fields are represented
as strings with their names, not numbers in enum.
To make metadata easier to read convert to json where fields are represented as strings with their names not numbers in enum .
fn serialize_field_to_meta<S>(
    meta: &[FieldMeta; FIELDS_NUM],
    serializer: S,
) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    let mut map = FieldMetaMap(HashMap::new());
    for field in Fields::iterator() {
        map.0.insert(*field, meta[*field as usize].clone());
    }
    map.serialize(serializer)
}
fn serialize_field_to_meta < S > ( meta : & [ FieldMeta ; FIELDS_NUM ] , serializer : S , ) -> Result < S :: Ok , S :: Error > where S : Serializer , { let mut map = FieldMetaMap ( HashMap :: new ( ) ) ; for field in Fields :: iterator ( ) { map . 0 . insert ( * field , meta [ * field as usize ] . clone ( ) ) ; } map . serialize ( serializer ) }
To make metadata easier to read, convert to json where fields are represented
as strings with their names, not numbers in enum.
To make metadata easier to read convert to json where fields are represented as strings with their names not numbers in enum .
meta
&[FieldMeta; FIELDS_NUM]
serializer
S
meta
&[FieldMeta; FIELDS_NUM]
serializer
S