pub struct BusLocalHub<Owner, ChannelId: Hash + PartialEq + Eq> { /* private fields */ }Implementations§
Source§impl<Owner: Clone + Debug + PartialEq, ChannelId: Debug + Clone + Copy + Hash + PartialEq + Eq> BusLocalHub<Owner, ChannelId>
impl<Owner: Clone + Debug + PartialEq, ChannelId: Debug + Clone + Copy + Hash + PartialEq + Eq> BusLocalHub<Owner, ChannelId>
Sourcepub fn subscribe(&mut self, owner: Owner, channel: ChannelId) -> bool
pub fn subscribe(&mut self, owner: Owner, channel: ChannelId) -> bool
subscribe to a channel. if it is first time subscription, return true; else return false
Sourcepub fn unsubscribe(&mut self, owner: Owner, channel: ChannelId) -> bool
pub fn unsubscribe(&mut self, owner: Owner, channel: ChannelId) -> bool
unsubscribe from a channel. if it is last time unsubscription, return true; else return false
Sourcepub fn get_subscribers(&self, channel: ChannelId) -> Option<Vec<Owner>>
pub fn get_subscribers(&self, channel: ChannelId) -> Option<Vec<Owner>>
get all subscribers of a channel
Trait Implementations§
Auto Trait Implementations§
impl<Owner, ChannelId> Freeze for BusLocalHub<Owner, ChannelId>
impl<Owner, ChannelId> RefUnwindSafe for BusLocalHub<Owner, ChannelId>where
ChannelId: RefUnwindSafe,
Owner: RefUnwindSafe,
impl<Owner, ChannelId> Send for BusLocalHub<Owner, ChannelId>
impl<Owner, ChannelId> Sync for BusLocalHub<Owner, ChannelId>
impl<Owner, ChannelId> Unpin for BusLocalHub<Owner, ChannelId>
impl<Owner, ChannelId> UnwindSafe for BusLocalHub<Owner, ChannelId>where
ChannelId: UnwindSafe,
Owner: UnwindSafe,
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