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§
Sourcefn 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 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,
执行命令
Sourcefn required_components(&self) -> Vec<ComponentType>
fn required_components(&self) -> Vec<ComponentType>
获取所需的组件类型
Sourcefn description(&self) -> &str
fn description(&self) -> &str
命令描述