Skip to main content

CliExtension

Trait CliExtension 

Source
pub trait CliExtension: Send + Sync {
    type Command: Send + Sync;

    // Required method
    fn handle_command(
        &self,
        command: Self::Command,
    ) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Extension point for domain-specific CLI commands.

Domain applications implement this trait to add custom subcommands beyond the built-in base commands.

Required Associated Types§

Source

type Command: Send + Sync

The domain-specific command type.

Required Methods§

Source

fn handle_command( &self, command: Self::Command, ) -> impl Future<Output = Result<()>> + Send

Handle a domain-specific command.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§