pub trait ICommand<H: IHandler, S: ISuccess, F: IFailure>:
Display
+ Send
+ Sync {
// Required methods
fn new<T: Executable + Send + Sync + 'static>(
request: T,
handler: H,
) -> Self;
fn execute<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<S, F>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
A command that pairs a request with its handler for execution.
Required Methods§
Sourcefn new<T: Executable + Send + Sync + 'static>(request: T, handler: H) -> Self
fn new<T: Executable + Send + Sync + 'static>(request: T, handler: H) -> Self
Create a command from a request and its matched handler.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".