Skip to main content

WireBuilder

Derive Macro WireBuilder 

Source
#[derive(WireBuilder)]
{
    // Attributes available to this derive:
    #[wire]
}
Expand description

Generates Type::builder(required_fields...) and a TypeBuilder.

Required fields are supplied in declaration order. Option<T> fields start as None and have setters accepting T; rest starts empty and has a setter accepting its declared type. build() returns the completed value. Mark a nullable but required field with #[wire(required)] to require an explicit Option<T> argument instead of defaulting it in the builder.