EntityCommand

Trait EntityCommand 

Source
pub trait EntityCommand:
    Send
    + Sync
    + Debug {
    // Required methods
    fn kind(&self) -> CommandKind;
    fn name(&self) -> &'static str;
}
Expand description

Base trait for entity commands.

Generated command enums implement this trait, enabling generic command handling, auditing, and dispatching.

§Example

fn audit_command<C: EntityCommand>(cmd: &C) {
    log::info!("Executing command: {} ({:?})", cmd.name(), cmd.kind());
}

Required Methods§

Source

fn kind(&self) -> CommandKind

Get the kind of command for categorization.

Source

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

Get the command name as a string for logging/auditing.

Implementors§