Skip to main content

AbstractCommand

Trait AbstractCommand 

Source
pub trait AbstractCommand {
    // Required method
    fn command_name(&self) -> CommandName;

    // Provided methods
    fn spec(&self) -> &'static CommandSpec { ... }
    fn load<I, S>(&self, args: I) -> Result<ActionInvocation, CommandParseError>
       where I: IntoIterator<Item = S>,
             S: Into<String> { ... }
}
Expand description

Typed Rust equivalent of upstream AbstractCommand.

Upstream command classes bind a concrete action and register a commander callback. In this port the commander callback is represented by load, which parses command-local arguments into the same action invocation shape.

Required Methods§

Provided Methods§

Source

fn spec(&self) -> &'static CommandSpec

Source

fn load<I, S>(&self, args: I) -> Result<ActionInvocation, CommandParseError>
where I: IntoIterator<Item = S>, S: Into<String>,

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§