pub struct Dispatcher { /* private fields */ }Expand description
Routes notifications to registered senders by channel name.
Implementations§
Source§impl Dispatcher
impl Dispatcher
Sourcepub fn register(&mut self, sender: Arc<dyn Sender>) -> &mut Self
pub fn register(&mut self, sender: Arc<dyn Sender>) -> &mut Self
Register a sender for its channel; a later registration for the same channel replaces the earlier one.
Sourcepub async fn dispatch(
&self,
channel: &str,
recipient: &str,
notif: &Notification,
) -> Result<(), NotifyError>
pub async fn dispatch( &self, channel: &str, recipient: &str, notif: &Notification, ) -> Result<(), NotifyError>
Dispatch to the sender registered under channel.
Trait Implementations§
Source§impl Clone for Dispatcher
impl Clone for Dispatcher
Source§fn clone(&self) -> Dispatcher
fn clone(&self) -> Dispatcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for Dispatcher
impl Default for Dispatcher
Source§fn default() -> Dispatcher
fn default() -> Dispatcher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Dispatcher
impl !UnwindSafe for Dispatcher
impl Freeze for Dispatcher
impl Send for Dispatcher
impl Sync for Dispatcher
impl Unpin for Dispatcher
impl UnsafeUnpin for Dispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more