pub struct MeshPeerEventBus { /* private fields */ }Expand description
Fan-out bus for MeshPeerEvent (tokio broadcast).
Multiple subscribers (cluster membership, observability, tests) can each hold a receiver. Slow consumers lag and skip old events rather than blocking mesh I/O.
Implementations§
Source§impl MeshPeerEventBus
impl MeshPeerEventBus
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a bus with an explicit ring capacity.
Sourcepub fn emit(&self, event: MeshPeerEvent)
pub fn emit(&self, event: MeshPeerEvent)
Publish a peer event (best-effort; no-op when no receivers).
Sourcepub fn subscribe(&self) -> Receiver<MeshPeerEvent>
pub fn subscribe(&self) -> Receiver<MeshPeerEvent>
Subscribe to the peer-event stream.
Sourcepub fn receiver_count(&self) -> usize
pub fn receiver_count(&self) -> usize
Number of active receivers.
Sourcepub fn sender(&self) -> Sender<MeshPeerEvent>
pub fn sender(&self) -> Sender<MeshPeerEvent>
Shared sender for advanced wiring (e.g. external discovery).
Trait Implementations§
Source§impl Clone for MeshPeerEventBus
impl Clone for MeshPeerEventBus
Source§impl Debug for MeshPeerEventBus
impl Debug for MeshPeerEventBus
Auto Trait Implementations§
impl !RefUnwindSafe for MeshPeerEventBus
impl !UnwindSafe for MeshPeerEventBus
impl Freeze for MeshPeerEventBus
impl Send for MeshPeerEventBus
impl Sync for MeshPeerEventBus
impl Unpin for MeshPeerEventBus
impl UnsafeUnpin for MeshPeerEventBus
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
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