Derive Macro simics::FromAttrValueDict

source ·
#[derive(FromAttrValueDict)]
{
    // Attributes available to this derive:
    #[attr_value]
}
Expand description

Derive Macro for implementing conversion from an AttrValue dict into a struct, where each key, value pair in the dict is a struct field’s name, value pair.

§Arguments

At the field level (i.e. on each field of a struct deriving this attribute), the following attributes are supported:

  • #[attr_value(fallible)] - If the field type does not implement From<AttrValue>, use its implementation of TryFrom<AttrValue> instead. Whether this flag is necessary cannot be automatically determined by this macro, so it must be specified manually.