pub trait CliTool<T: Serialize + Send>:
Sized
+ Send
+ Parser {
// Required method
fn execute<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = CliTypedResult<T>> + Send + 'async_trait>>
where Self: 'async_trait;
// Provided methods
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§
Sourcefn execute_serialized<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = CliResult> + 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,
Executes the command, and serializes it to the common JSON output type
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.