Skip to main content

ComponentStorage

Derive Macro ComponentStorage 

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

Derive macro for ComponentStorage that generates standard HashMap-based implementations.

Requires a #[component(field = "field_name")] attribute specifying the HashMap field in EntityRegistryInternal.

§Example

#[derive(ComponentStorage)]
#[component(field = "names")]
pub struct Name(String);