#[derive(DeserializeNode)]
{
// Attributes available to this derive:
#[dt]
}
Expand description
Derive macro generating an impl of the trait DeserializeNode.
Requires an implementation of Default.
Attribute syntax:
#[dt(start_cursor)]#[dt(name)]#[dt(unit_address)]#[dt(property)]#[dt(property = \"<property name>\")]#[dt(child)]#[dt(child = \"<node name>\")]#[dt(children)]#[dt(children = \"<node name>\")]#[dt(children(rest))]
The default item name is the field name with undescores replaced by hyphens
(and a # prepended in case the name ends with _cells), except
device_type, which uses an underscore.
The unit address is ignored.
-
#[dt(start_cursor)]stores a cursor to the containing node in that field (typeOption<Cursor>). -
#[dt(name)]stores the containing node’s entire name in that field (typeT where T: From<&'dtb str>). -
#[dt(unit_address)]stores the containing node’s unit address in that field (typeOption<T> where T: From<&'dtb str>). -
#[dt(property)](default) usesDeserializeProperty -
#[dt(child)]usesDeserializeNode -
#[dt(children)]usesPushDeserializedNodeto collect items of typeSelf::Node; it is similar toExtend<Self::Node>
DeserializeNode::deserialize is always used with an appropriate
NodeContext.
The lifetime 'dtb (if it exists) is special because it will be used for
the DeserializeNode<'dtb> implementation.