[][src]Trait muoxi_staging::prelude::Command

pub trait Command: Debug + Sync {
    fn name(&self) -> &str;
fn aliases(&self) -> Vec<&str>;
fn execute_cmd<'life0, 'life1, 'async_trait>(
        &'life0 self,
        game_server: &'life1 mut Client
    ) -> Pin<Box<dyn Future<Output = CommandResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn is_match<'a>(&self, cmd: &'a str) -> bool { ... } }

defines a command trait

Required methods

fn name(&self) -> &str

name of command

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

a list of aliases that will invoke command

fn execute_cmd<'life0, 'life1, 'async_trait>(
    &'life0 self,
    game_server: &'life1 mut Client
) -> Pin<Box<dyn Future<Output = CommandResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

execute the actual command but only directs commands to game_server, will err if client state is not in playing

Loading content...

Provided methods

fn is_match<'a>(&self, cmd: &'a str) -> bool

tests to see if supplied string is a valid command

Loading content...

Implementors

impl Command for CmdProxyAccount[src]

impl Command for CmdProxyNew[src]

Loading content...