Derive Macro Unit
#[derive(Unit)]
{
// Attributes available to this derive:
#[inspect]
}
Expand description
The Unit
derive macro can be applied to named structs in order to generate an
implementation of the Unit
trait. The name of the field corresponds to the
inspect node or property name, and the type of the field must also implement Unit
.
Implementations of Unit
are supplied for most primitives and String
.
Example:
#[derive(Unit)]
struct Point {
x: f32,
y: f32,
}
The Unit
derive macro. Requires that the type is a named struct.
Type- and lifetime parameters are supported if they are ignored.
The only supported field-level attribute is inspect(skip)
.