pub fn to_hash_map<T>(value: &T) -> Result<HashMap<String, String>>
where
    T: Serialize,
{
    let mut serializer = Serializer {
        output: HashMap::new(),
        current_field: None,
        sequence: None,
        value: None,
    };
    value.serialize(&mut serializer)?;
    Ok(serializer.output)
}
/// This method tries to convert any struct into a HashMap.
/// Other types (e.g. tuples, sequences etc.) are not supported
///
/// NOTE: There will be edge-cases that this method does not support.
/// One example being conflicts. Two things can map to the same key.
/// We don't currently check for that.
///
/// Field names of structs will be the keys of the resulting map.
/// These field types are supported:
///
/// * bool (conversion will be to "true" or "false")
/// * integer types
/// * floating-point types
/// * char
/// * String/str
/// * Option: Will be serialized as just the contained value if it's Some. None will be omitted entirely.
/// * Unit: Will be omitted
/// * Unit struct: Will be omitted
/// * Enum
/// * Newtype structs: Will be serialized as the data they contain (the "wrapper" will be ignored)
/// * Newtype variant (Newtype variant of enums): Will be serialized as the data they contain (that means the Enum variant name will be ignored as well as the newtype wrapper!)
/// * Map: The fields of the nested map will be emitted using a dotted syntax (e.g. "parent_field.nested_field")
/// * structs: See Map
/// * struct variant: See Map
///
/// These are supported with some limitations:
/// * sequences (e.g. Vec)
/// * tuple
/// * tuple struct
/// * tuple variant (see sequence)
///
/// The limitation being that currently we do not support any of these in a nested fashion (e.g. a vector of tuples).
/// There will be no error but the result will be undefined.
/// This is an implementation limitation that can be lifted later if needed.
///
/// These are not supported:
/// * bytes
This method tries to convert any struct into a HashMap.
Other types  are not supported

There will be edge-cases that this method does not support.
One example being conflicts. Two things can map to the same key.
We don't currently check for that.

Field names of structs will be the keys of the resulting map.
These field types are supported.

bool (conversion will be to "true" or "false")
integer types
floating-point types
char
String/str
Option: Will be serialized as just the contained value if it's Some. None will be omitted entirely.

These are supported with some limitations:
sequences
tuple
tuple struct
tuple variant

The limitation being that currently we do not support any of these in a nested fashion .
There will be no error but the result will be undefined.
This is an implementation limitation that can be lifted later if needed.

These are not supported:
bytes
This method tries to convert any struct into a HashMap . Other types are not supported There will be edge - cases that this method does not support . One example being conflicts . Two things can map to the same key . We don ' t currently check for that . Field names of structs will be the keys of the resulting map . These field types are supported . bool ( conversion will be to " true " or " false " ) integer types floating - point types char String / str Option : Will be serialized as just the contained value if it ' s Some . None will be omitted entirely . These are supported with some limitations : sequences tuple tuple struct tuple variant The limitation being that currently we do not support any of these in a nested fashion . There will be no error but the result will be undefined . This is an implementation limitation that can be lifted later if needed . These are not supported : bytes
pub fn to_hash_map<T>(value: &T) -> Result<HashMap<String, String>>
where
    T: Serialize,
{
    let mut serializer = Serializer {
        output: HashMap::new(),
        current_field: None,
        sequence: None,
        value: None,
    };
    value.serialize(&mut serializer)?;
    Ok(serializer.output)
}
pub fn to_hash_map < T > ( value : & T ) -> Result < HashMap < String , String > > where T : Serialize , { let mut serializer = Serializer { output : HashMap :: new ( ) , current_field : None , sequence : None , value : None , } ; value . serialize ( & mut serializer ) ? ; Ok ( serializer . output ) }
This method tries to convert any struct into a HashMap.
This method tries to convert any struct into a HashMap .
value
&T