Skip to main content

RunCommand

Trait RunCommand 

Source
pub trait RunCommand<A, S>
where S: Clone + Send + Sync + 'static, AppContext: FromRef<S>, A: App<S> + Sync,
{ // Required method fn run<'life0, 'life1, 'async_trait>( &'life0 self, cli: &'life1 CliState<A, S>, ) -> Pin<Box<dyn Future<Output = RoadsterResult<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; }
Expand description

Implement to enable Roadster to run your custom CLI commands.

Required Methods§

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 self, cli: &'life1 CliState<A, S>, ) -> Pin<Box<dyn Future<Output = RoadsterResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run the command.

§Returns
  • Ok(true) - If the implementation handled the command and thus the app should end execution after the command is complete.
  • Ok(false) - If the implementation did not handle the command and thus the app should continue execution after the command is complete.
  • Err(...) - If the implementation experienced an error while handling the command. The app should end execution after the command is complete.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<S> RunCommand<RoadsterApp<S>, S> for Empty
where S: Clone + Send + Sync + 'static, AppContext: FromRef<S>,