Skip to main content

CommandHook

Trait CommandHook 

Source
pub trait CommandHook: Send + Sync {
    // Provided methods
    fn before_execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _cmd_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = CliResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn after_execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _cmd_name: &'life1 str,
        _success: bool,
    ) -> Pin<Box<dyn Future<Output = CliResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Hook trait for command lifecycle events.

Provided Methods§

Source

fn before_execute<'life0, 'life1, 'async_trait>( &'life0 self, _cmd_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = CliResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called before command execution.

Source

fn after_execute<'life0, 'life1, 'async_trait>( &'life0 self, _cmd_name: &'life1 str, _success: bool, ) -> Pin<Box<dyn Future<Output = CliResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called after command execution.

Implementors§