pub trait Command {
// Required methods
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
bot: &'life1 Bot,
) -> Pin<Box<dyn Future<Output = CliResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn name(&self) -> &'static str;
// Provided methods
fn execute_with_output<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
bot: &'life1 Bot,
_output_format: &'life2 OutputFormat,
) -> Pin<Box<dyn Future<Output = CliResult<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn validate(&self) -> CliResult<()> { ... }
}Expand description
Trait that all CLI commands must implement
Required Methods§
Provided Methods§
Sourcefn execute_with_output<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
bot: &'life1 Bot,
_output_format: &'life2 OutputFormat,
) -> Pin<Box<dyn Future<Output = CliResult<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_with_output<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
bot: &'life1 Bot,
_output_format: &'life2 OutputFormat,
) -> Pin<Box<dyn Future<Output = CliResult<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute the command with structured output support (optional implementation)