Skip to main content

Run

Trait Run 

Source
pub trait Run {
    type Output;

    // Required method
    fn run(self) -> Self::Output;
}
Expand description

A command that can be carried out with nothing but what it parsed.

The output is the implementation’s own: Result<(), E> for a CLI whose commands can fail, () for one whose commands cannot, ExitCode for one that decides its own status. A generated dispatcher takes its output from the first command it routes to and requires the rest to agree, since a match has one type.

Required Associated Types§

Source

type Output

What running the command produces.

Required Methods§

Source

fn run(self) -> Self::Output

Carry out the command.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§