use super::sync;
use crate::Event;
pub struct Dispatcher {
dispatcher: sync::Dispatcher,
}
impl Dispatcher {
#[must_use]
pub const fn new() -> Self {
Self {
dispatcher: sync::Dispatcher::new(),
}
}
pub fn listen<Ev: Event + 'static>(
&mut self,
on_event: impl FnMut(&mut Ev) + 'static,
) -> Result<(), sync::Error> {
self.dispatcher.listen(on_event)
}
pub fn has_listeners<Ev: Event + 'static>(&self) -> Result<bool, sync::Error> {
self.dispatcher.has_listeners::<Ev>()
}
pub fn dispatch<Ev: Event + 'static>(&self, _: &mut Ev) {
}
}