Skip to main content

CommandHook

Trait CommandHook 

Source
pub trait CommandHook: Send + Sync {
    // Provided methods
    fn before_command(
        &mut self,
        _command: &str,
        _args: &str,
    ) -> CommandHookResult { ... }
    fn after_command(&mut self, _command: &str, _args: &str, _success: bool) { ... }
}
Expand description

Hook for intercepting command execution.

Provided Methods§

Source

fn before_command(&mut self, _command: &str, _args: &str) -> CommandHookResult

Called before a command is executed.

Return CommandHookResult::Handled to prevent the default handler.

Source

fn after_command(&mut self, _command: &str, _args: &str, _success: bool)

Called after a command is executed.

Implementors§