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§
Sourcefn get_command(&self, name: &str) -> Result<Command, NoSuchCommand>
fn get_command(&self, name: &str) -> Result<Command, NoSuchCommand>
Returns the command with the given name.
Sourcefn get_commands(&self) -> Vec<Command>
fn get_commands(&self) -> Vec<Command>
Returns all commands.
Sourcefn register_command(
&self,
command: Command,
) -> Result<(), CommandRegistrationError>
fn register_command( &self, command: Command, ) -> Result<(), CommandRegistrationError>
Registers a new command.
Sourcefn register_singleton_command(
&self,
command: Command,
entity_type: EntityType,
) -> Result<(), CommandRegistrationError>
fn register_singleton_command( &self, command: Command, entity_type: EntityType, ) -> Result<(), CommandRegistrationError>
Registers a new singleton command.