pub trait Command: Clone {
type Parsed: ParsedCommand;
type Action;
type Context;
type CommandContext: From<Self::Context>;
// Required methods
fn name(&self) -> String;
fn aliases(&self) -> Vec<String>;
fn exec(
&self,
cmd: Self::Parsed,
ctx: &mut Self::CommandContext
) -> CommandResult<Self>;
}
Expand description
Trait for mapped commands.
Required Associated Types§
sourcetype Parsed: ParsedCommand
type Parsed: ParsedCommand
Result of parsing a command string.
sourcetype CommandContext: From<Self::Context>
type CommandContext: From<Self::Context>
Context to be passed to Command::exec.
Required Methods§
sourcefn exec(
&self,
cmd: Self::Parsed,
ctx: &mut Self::CommandContext
) -> CommandResult<Self>
fn exec( &self, cmd: Self::Parsed, ctx: &mut Self::CommandContext ) -> CommandResult<Self>
Execute this command.
Object Safety§
This trait is not object safe.