Derive Macro simics::IntoAttrValueDict

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

Derive Macro for implementing conversion into an AttrValue dictionary, where each struct field’s key, value pair is an entry in the dictionary.

§Arguments

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

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