Crate struct_mapping

Source
Expand description

§StructMapping

StructMapping is a library for create string-based accessors/mutators Rust data structure..

§Custom type implementation

use struct_mapping::ToStructMappingField;

#[inline]
fn sm_mutator(key: &str, value: &str) -> Result<Self, MutatorError> {
    value
        .parse::<bool>()
        .map_err(|err| MutatorError::InvalidValue {
            key: key.to_string(),
            error: err.to_string(),
        })
}

Enums§

MutatorError

Traits§

ToStructMappingField
The public trait ToStructMappingField allows to implement a new type serialization