Attribute Macro blueprint

Source
#[blueprint]
Expand description

Defines a blueprint for creating a view from config.

It should be added to a type which defines how to build the view.

§Examples

#[cursive::blueprint(TextView::empty())]
struct BlueprintForTextview {
  content: StyledString,
}

This recipe will:

  • Create a base view with TextView::empty().
  • Look for a content key in the given config.
  • Try to resolve the associated value to a StyledString.
  • Call set_content on the base with the resulting StyledString.