pub trait CliTool<T: Serialize + Send>: Sized + Send + Parser {
fn execute<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = CliTypedResult<T>> + Send + 'async_trait>>
where
Self: 'async_trait;
fn execute_serialized<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = CliResult> + Send + 'async_trait>>
where
Self: 'async_trait,
{ ... }
fn execute_serialized_success<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = CliResult> + Send + 'async_trait>>
where
Self: 'async_trait,
{ ... }
fn execute_main<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
Self: 'async_trait,
{ ... }
}
Expand description
A common trait for all CLI commands to have consistent outputs
Required methods
Provided methods
Executes the command, and serializes it to the common JSON output type
Executes the command, and throws away Ok(result) for the string Success