pub trait Prop {
    type Builder;

    fn builder() -> Self::Builder;
}
Expand description

A trait that is implemented automatically by the Prop derive macro.

This is used when constructing components in the view! macro.

Example

Deriving an implementation and using the builder to construct an instance of the struct:

#[derive(Prop)]
struct ButtonProps {
    color: String,
    disabled: bool,
}

let builder = <ButtonProps as Prop>::builder();
let button_props = builder.color("red".to_string()).disabled(false).build();

Required Associated Types

The type of the builder. This allows getting the builder type when the name is unknown (e.g. in a macro).

Required Methods

Returns the builder for the type. The builder should be automatically generated using the Prop derive macro.

Implementors