Command

Trait Command 

Source
pub trait Command: Send + Sync {
    // Required methods
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        context: &'life1 CommandContext,
    ) -> Pin<Box<dyn Future<Output = Result<CommandResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn required_components(&self) -> Vec<ComponentType>;
    fn name(&self) -> &str;
    fn description(&self) -> &str;
}
Expand description

命令接口

Required Methods§

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 CommandContext, ) -> Pin<Box<dyn Future<Output = Result<CommandResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

执行命令

Source

fn required_components(&self) -> Vec<ComponentType>

获取所需的组件类型

Source

fn name(&self) -> &str

命令名称

Source

fn description(&self) -> &str

命令描述

Implementors§