Skip to main content

SubCommands

Trait SubCommands 

Source
pub trait SubCommands: FromArgs {
    const COMMANDS: &'static [&'static CommandInfo<'static>];

    // Provided method
    fn dynamic_commands() -> &'static [&'static CommandInfo<'static>] { ... }
}
Expand description

A FromArgs implementation that can parse into one or more subcommands.

Required Associated Constants§

Source

const COMMANDS: &'static [&'static CommandInfo<'static>]

Info for the commands.

Provided Methods§

Source

fn dynamic_commands() -> &'static [&'static CommandInfo<'static>]

Get a list of commands that are discovered at runtime.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T> SubCommands for T
where T: SubCommand,

Source§

const COMMANDS: &'static [&'static CommandInfo<'static>]