Trait CommandManager

Source
pub trait CommandManager:
    Send
    + Sync
    + Lifecycle {
    // Required methods
    fn get_command(&self, name: &str) -> Result<Command, NoSuchCommand>;
    fn get_commands(&self) -> Vec<Command>;
    fn register_command(
        &self,
        command: Command,
    ) -> Result<(), CommandRegistrationError>;
    fn register_singleton_command(
        &self,
        command: Command,
        entity_type: EntityType,
    ) -> Result<(), CommandRegistrationError>;
}

Required Methods§

Source

fn get_command(&self, name: &str) -> Result<Command, NoSuchCommand>

Returns the command with the given name.

Source

fn get_commands(&self) -> Vec<Command>

Returns all commands.

Source

fn register_command( &self, command: Command, ) -> Result<(), CommandRegistrationError>

Registers a new command.

Source

fn register_singleton_command( &self, command: Command, entity_type: EntityType, ) -> Result<(), CommandRegistrationError>

Registers a new singleton command.

Trait Implementations§

Source§

impl Injectable for dyn CommandManager + Sync + Send

Implementors§