pub trait CommandExecutor {
// Required methods
fn execute_with_result<'life0, 'life1, 'async_trait>(
&'life0 self,
bot: &'life1 Bot,
) -> Pin<Box<dyn Future<Output = CommandResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn name(&self) -> &'static str;
// Provided method
fn validate(&self) -> CliResult<()> { ... }
}Expand description
New trait for commands that return structured results
Required Methods§
Sourcefn execute_with_result<'life0, 'life1, 'async_trait>(
&'life0 self,
bot: &'life1 Bot,
) -> Pin<Box<dyn Future<Output = CommandResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_with_result<'life0, 'life1, 'async_trait>(
&'life0 self,
bot: &'life1 Bot,
) -> Pin<Box<dyn Future<Output = CommandResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the command and return structured result