ComponentId

Trait ComponentId 

Source
pub trait ComponentId:
    Clone
    + Copy
    + Eq
    + Hash
    + Debug {
    // Required method
    fn name(&self) -> &'static str;
}
Expand description

Trait for user-defined component identifiers

Implement this trait for your own component ID enum, or use #[derive(ComponentId)] from tui-dispatch-macros to auto-generate the implementation.

§Example

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

Required Methods§

Source

fn name(&self) -> &'static str

Get the component name as a string (for debugging/logging)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§