mediator_sys/mediator/asynchronous/contextaware/
interface.rs1use async_trait::async_trait;
2use std::fmt::Debug;
3
4#[async_trait]
8pub trait CxAwareAsyncMediatorInternalHandle<Dep, Ev: Debug> {
9 async fn send<Req>(&self, req: Req)
10 where
11 Req: Send,
12 Self: CxAwareAsyncRequestHandler<Dep, Req, Ev>;
13}
14
15#[async_trait]
19pub trait CxAwareAsyncRequestHandler<Dep, Req, Res> {
20 async fn handle(&self, req: Req, dep: &Dep);
21}
22
23pub trait CxAwareMediatorBuilderInterface<M, Dep, Ev> {
26 fn add_dependency(self, dep: Dep) -> Self
27 where
28 Ev: Debug;
29}