pub struct ClusterEventBus { /* private fields */ }Expand description
In-process cluster events bus.
Implementations§
Source§impl ClusterEventBus
impl ClusterEventBus
pub fn new() -> Self
Sourcepub fn subscribe<F>(&self, callback: F) -> SubscriptionHandle
pub fn subscribe<F>(&self, callback: F) -> SubscriptionHandle
Register a subscriber that fires on every event. Returns a
handle whose Drop removes the subscription.
Sourcepub fn publish(&self, event: ClusterEvent)
pub fn publish(&self, event: ClusterEvent)
Publish an event to all current subscribers, synchronously, in registration order. Subscribers must not block.
Sourcepub fn subscriber_count(&self) -> usize
pub fn subscriber_count(&self) -> usize
Number of currently registered subscribers.
Trait Implementations§
Source§impl Clone for ClusterEventBus
impl Clone for ClusterEventBus
Source§fn clone(&self) -> ClusterEventBus
fn clone(&self) -> ClusterEventBus
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ClusterEventBus
impl Default for ClusterEventBus
Source§fn default() -> ClusterEventBus
fn default() -> ClusterEventBus
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClusterEventBus
impl !RefUnwindSafe for ClusterEventBus
impl Send for ClusterEventBus
impl Sync for ClusterEventBus
impl Unpin for ClusterEventBus
impl UnsafeUnpin for ClusterEventBus
impl !UnwindSafe for ClusterEventBus
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