pub struct ChannelRouter { /* private fields */ }Expand description
Routes messages to named channels.
Implementations§
Source§impl ChannelRouter
impl ChannelRouter
pub fn new() -> Self
pub fn add_channel(&mut self, name: &str)
pub fn subscribe(&mut self, channel: &str, topic_prefix: &str)
pub fn route(&mut self, topic: &str, payload: &str)
pub fn drain_channel(&mut self, channel: &str) -> Vec<RoutedMessage>
pub fn channel_count(&self) -> usize
pub fn pending_count(&self, channel: &str) -> usize
pub fn total_routed(&self) -> u64
pub fn has_channel(&self, name: &str) -> bool
pub fn remove_channel(&mut self, name: &str)
pub fn clear_all(&mut self)
Trait Implementations§
Source§impl Clone for ChannelRouter
impl Clone for ChannelRouter
Source§fn clone(&self) -> ChannelRouter
fn clone(&self) -> ChannelRouter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChannelRouter
impl Debug for ChannelRouter
Auto Trait Implementations§
impl Freeze for ChannelRouter
impl RefUnwindSafe for ChannelRouter
impl Send for ChannelRouter
impl Sync for ChannelRouter
impl Unpin for ChannelRouter
impl UnsafeUnpin for ChannelRouter
impl UnwindSafe for ChannelRouter
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