Struct sans_io_runtime::bus::BusLocalHub
source · 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
sourcepub fn remove_owner(&mut self, owner: Owner)
pub fn remove_owner(&mut self, owner: Owner)
remove owner from all channels
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