Trait dynomite::FromAttributes [−][src]
pub trait FromAttributes: Sized { fn from_attrs(attrs: &mut Attributes) -> Result<Self, AttributeError>; }
Expand description
A type capable of being produced from a set of string keys and AttributeValue
s.
Generally, you should not implement this trait manually.
Use #[derive(Attributes/Item)]
to generate the proper implementation instead.
Required methods
fn from_attrs(attrs: &mut Attributes) -> Result<Self, AttributeError>
[src]
fn from_attrs(attrs: &mut Attributes) -> Result<Self, AttributeError>
[src]Returns an instance of of a type resolved at runtime from a collection
of a String
keys and AttributeValue
s.
If an instance can not be resolved and AttributeError
will be returned.
The implementations of this method should remove the relevant key-value
pairs from the map to consume them.
This is needed to support #[dynomite(flatten)]
without creating temporary hash maps.
Implementations on Foreign Types
Coerces a homogeneous HashMap of attribute values into a homogeneous Map of types
that implement Attribute
Coerces a homogenious Map of attribute values into a homogeneous BTreeMap of types that implement Attribute