Skip to main content

ArgotCommand

Trait ArgotCommand 

Source
pub trait ArgotCommand {
    // Required method
    fn command() -> Command;
}
Expand description

Trait implemented by types annotated with #[derive(ArgotCommand)].

Call T::command() to obtain a fully-built Command from the struct’s #[argot(...)] attributes.

§Examples

use argot_cmd::ArgotCommand;

#[derive(argot_cmd::ArgotCommand)]
#[argot(summary = "Greet the world")]
struct Greet;

let cmd = Greet::command();
assert_eq!(cmd.canonical, "greet");

Required Methods§

Source

fn command() -> Command

Return the Command described by this type’s #[argot(...)] attributes.

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§