pub trait RunWith<Ctx> {
type Output;
// Required method
fn run_with(self, ctx: Ctx) -> Self::Output;
}Expand description
A command that is handed something shared when it runs.
Ctx is whatever the CLI has to give: &Config, &mut App, an owned handle. It is a
parameter of the trait rather than of the method so that one command may be runnable with
several — a leaf that needs only a config can implement RunWith<&Config> while its
siblings implement RunWith<&mut App>, as long as the enum dispatching them agrees on
one.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".