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
Traits
The public trait
ToStructMappingField allows to implement a new type serialization