pub struct ConnectionEventBroadcaster { /* private fields */ }Expand description
Connection event broadcaster
Manages a broadcast channel for distributing connection events to all subscribed layers.
Implementations§
Source§impl ConnectionEventBroadcaster
impl ConnectionEventBroadcaster
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new broadcaster with specified capacity
Sourcepub fn send(&self, event: ConnectionEvent) -> usize
pub fn send(&self, event: ConnectionEvent) -> usize
Send an event to all subscribers
Returns the number of receivers that received the event. Returns 0 if there are no active subscribers (not an error).
Sourcepub fn subscribe(&self) -> Receiver<ConnectionEvent>
pub fn subscribe(&self) -> Receiver<ConnectionEvent>
Subscribe to connection events
Sourcepub fn receiver_count(&self) -> usize
pub fn receiver_count(&self) -> usize
Get the number of active subscribers
Sourcepub fn sender(&self) -> Sender<ConnectionEvent>
pub fn sender(&self) -> Sender<ConnectionEvent>
Get a clone of the sender for sharing
Trait Implementations§
Source§impl Clone for ConnectionEventBroadcaster
impl Clone for ConnectionEventBroadcaster
Source§impl Debug for ConnectionEventBroadcaster
impl Debug for ConnectionEventBroadcaster
Auto Trait Implementations§
impl Freeze for ConnectionEventBroadcaster
impl !RefUnwindSafe for ConnectionEventBroadcaster
impl Send for ConnectionEventBroadcaster
impl Sync for ConnectionEventBroadcaster
impl Unpin for ConnectionEventBroadcaster
impl !UnwindSafe for ConnectionEventBroadcaster
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more