pub mod command_handlers;
pub mod query_handlers;
use crate::application::ApplicationResult;
use std::future::Future;
pub trait CommandHandlerGat<TCommand> {
type Response;
type HandleFuture<'a>: Future<Output = ApplicationResult<Self::Response>> + Send + 'a
where
Self: 'a;
fn handle(&self, command: TCommand) -> Self::HandleFuture<'_>;
}
pub trait QueryHandlerGat<TQuery> {
type Response;
type HandleFuture<'a>: Future<Output = ApplicationResult<Self::Response>> + Send + 'a
where
Self: 'a;
fn handle(&self, query: TQuery) -> Self::HandleFuture<'_>;
}