entity

Attribute Macro entity 

Source
#[entity]
Expand description

Derives the StateEntity trait for a struct.

§Attributes

  • #[stately(singleton)] - Marks this as a singleton entity
  • #[stately(name_field = "field_name")] - Uses a different field for the name (default: “name”)
  • #[stately(description_field = "field_name")] - Uses a specific field for description
  • #[stately(description = "text")] - Uses a static description

§Example

#[stately::entity]
pub struct Pipeline {
    pub name: String,
    pub source: Link<SourceConfig>,
}