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§
Sourcefn before_command(&mut self, _command: &str, _args: &str) -> CommandHookResult
fn before_command(&mut self, _command: &str, _args: &str) -> CommandHookResult
Called before a command is executed.
Return CommandHookResult::Handled to prevent the default handler.
Sourcefn after_command(&mut self, _command: &str, _args: &str, _success: bool)
fn after_command(&mut self, _command: &str, _args: &str, _success: bool)
Called after a command is executed.