BusLocalHub

Struct 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>

Source

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

Source

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

Source

pub fn get_subscribers(&self, channel: ChannelId) -> Option<Vec<Owner>>

get all subscribers of a channel

Trait Implementations§

Source§

impl<Owner: Debug, ChannelId: Debug + Hash + PartialEq + Eq> Debug for BusLocalHub<Owner, ChannelId>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Owner, ChannelId: Hash + PartialEq + Eq> Default for BusLocalHub<Owner, ChannelId>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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>
where ChannelId: Send, Owner: Send,

§

impl<Owner, ChannelId> Sync for BusLocalHub<Owner, ChannelId>
where ChannelId: Sync, Owner: Sync,

§

impl<Owner, ChannelId> Unpin for BusLocalHub<Owner, ChannelId>
where ChannelId: Unpin, Owner: Unpin,

§

impl<Owner, ChannelId> UnwindSafe for BusLocalHub<Owner, ChannelId>
where ChannelId: UnwindSafe, Owner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.