pub struct NotificationRouter { /* private fields */ }Expand description
Dispatches a single SinkEvent to multiple NotificationSinks.
Sinks are called sequentially (no async / thread overhead). For async
fan-out combine with crate::fan_pattern::FanExecutor.
Implementations§
Source§impl NotificationRouter
impl NotificationRouter
Sourcepub fn add_sink(&mut self, sink: Box<dyn NotificationSink>)
pub fn add_sink(&mut self, sink: Box<dyn NotificationSink>)
Add a sink.
Sourcepub fn sink_count(&self) -> usize
pub fn sink_count(&self) -> usize
Number of registered sinks.
Sourcepub fn dispatch(&self, event: &SinkEvent) -> RouterSummary
pub fn dispatch(&self, event: &SinkEvent) -> RouterSummary
Dispatch event to all registered sinks and return a RouterSummary.
Sourcepub fn sink_names(&self) -> Vec<&str>
pub fn sink_names(&self) -> Vec<&str>
Names of all registered sinks.
Trait Implementations§
Source§impl Debug for NotificationRouter
impl Debug for NotificationRouter
Source§impl Default for NotificationRouter
impl Default for NotificationRouter
Source§fn default() -> NotificationRouter
fn default() -> NotificationRouter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for NotificationRouter
impl !UnwindSafe for NotificationRouter
impl Freeze for NotificationRouter
impl Send for NotificationRouter
impl Sync for NotificationRouter
impl Unpin for NotificationRouter
impl UnsafeUnpin for NotificationRouter
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