Skip to main content

CommandHandler

Trait CommandHandler 

Source
pub trait CommandHandler<C: ShellConfig> {
    // Required method
    fn execute_sync(
        &self,
        id: &str,
        args: &[&str],
    ) -> Result<Response<C>, CliError>;
}
Expand description

Command execution handler trait. Maps command IDs to execution functions (dispatches on unique ID, not display name).

Required Methods§

Source

fn execute_sync(&self, id: &str, args: &[&str]) -> Result<Response<C>, CliError>

Execute synchronous command by unique ID.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§