Skip to main content

VirtualCommand

Trait VirtualCommand 

Source
pub trait VirtualCommand: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn execute(
        &self,
        args: &[String],
        ctx: &CommandContext<'_>,
    ) -> CommandResult;

    // Provided method
    fn meta(&self) -> Option<&'static CommandMeta> { ... }
}
Expand description

Trait for commands that can be registered and executed.

Required Methods§

Source

fn name(&self) -> &str

Source

fn execute(&self, args: &[String], ctx: &CommandContext<'_>) -> CommandResult

Provided Methods§

Source

fn meta(&self) -> Option<&'static CommandMeta>

Implementors§