Skip to main content

PluginCommand

Trait PluginCommand 

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

One CLI subcommand contributed by a plugin.

Required Methods§

Source

fn command(&self) -> Command

The clap subcommand. Command::get_name() is the literal the user types after the program name (umbral-cli <name>). Long-form help, arg parsing, and subcommand grouping are all the plugin’s to configure on the returned value.

Source

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

Run the command. Called after clap has parsed args matching self.command(); matches is the per-subcommand ArgMatches (not the top-level one).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§