Skip to main content

Command

Trait Command 

Source
pub trait Command:
    Send
    + Sync
    + 'static {
    // Required methods
    fn clap(&self) -> Command;
    fn dispatch<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        matches: ArgMatches,
        context: &'life1 Context<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Root of a clap command tree installed by a downstream crate.

Required Methods§

Source

fn clap(&self) -> Command

The clap command tree; equivalent to <C as clap::CommandFactory>::command().

Source

fn dispatch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, matches: ArgMatches, context: &'life1 Context<'life2>, ) -> Pin<Box<dyn Future<Output = Result> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dispatch already-parsed argument matches to the matching handler.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§