use std::{fmt::Debug, sync::mpsc::TryRecvError};
use crate::mediator::listener::Listener;
pub trait SyncMediatorInternal<Ev: Debug> {
#[allow(missing_docs)]
fn publish(&self, event: Ev);
}
pub trait SyncMediatorInternalHandle<Ev: Debug> {
#[allow(missing_docs)]
fn send<Req>(&self, req: Req)
where
Self: RequestHandler<Req, Ev>;
}
pub trait SyncMediatorInternalNext {
#[allow(missing_docs)]
fn next(&self) -> Result<(), TryRecvError>;
}
pub trait RequestHandler<Req, Res> {
#[allow(missing_docs)]
fn handle(&self, req: Req);
}
pub trait BasicMediatorBuilderInterface<M, Ev> {
#[allow(missing_docs)]
fn add_listener(self, f: impl Listener<Ev>) -> Self
where
Ev: Debug;
}