ComponentId

Derive Macro ComponentId 

Source
#[derive(ComponentId)]
Expand description

Derive macro for the ComponentId trait

Generates implementations for name() method that returns the variant name.

§Example

#[derive(ComponentId, Clone, Copy, PartialEq, Eq, Hash, Debug)]
enum MyComponentId {
    Sidebar,
    MainContent,
    StatusBar,
}

assert_eq!(MyComponentId::Sidebar.name(), "Sidebar");