pub trait CommandHandler: Send + Sync {
type Command: Command;
type Output: Serialize + DeserializeOwned + Send + 'static;
type Error: Error + Send + Sync + 'static;
type Uow: UnitOfWork;
// Required method
async fn handle(
&self,
uow: &mut Self::Uow,
request_context: &RequestContext,
command: Self::Command,
) -> Result<Self::Output, Self::Error>;
}Required Associated Types§
type Command: Command
type Output: Serialize + DeserializeOwned + Send + 'static
type Error: Error + Send + Sync + 'static
type Uow: UnitOfWork
Required Methods§
async fn handle( &self, uow: &mut Self::Uow, request_context: &RequestContext, command: Self::Command, ) -> Result<Self::Output, Self::Error>
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.