Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Trait Command

Source
pub trait Command {
    // Required methods
    fn usage() -> ClapCommand;
    fn handler<'life0, 'async_trait>(
        m: &'life0 ArgMatches,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait;
}
Expand description

Abstract commands’ trait.

Required Methods§

Source

fn usage() -> ClapCommand

Usage of the specific command

Source

fn handler<'life0, 'async_trait>( m: &'life0 ArgMatches, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,

The handler will deal [args, options,…] from the command-line

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§