Skip to main content

Command

Trait Command 

Source
pub trait Command:
    Any
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn aliases(&self) -> Vec<&'static str>;
    fn help(&self) -> &'static str;
    fn usage(&self) -> &'static str;
    fn execute<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        client: &'life1 Client,
        args: Vec<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Add a command to the plugin.

Required Methods§

Source

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

Name of the command.

Source

fn aliases(&self) -> Vec<&'static str>

Aliases for the command.

Source

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

Help message of the command.

Source

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

Usage message of the command.

Source

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, client: &'life1 Client, args: Vec<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Command function.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§