pub struct EventBus { /* private fields */ }Expand description
The main event bus for publish-subscribe communication.
Implementations§
Source§impl EventBus
impl EventBus
Sourcepub fn new(config: EventBusConfig) -> Self
pub fn new(config: EventBusConfig) -> Self
Create a new event bus with the given configuration.
Sourcepub fn publisher(&self) -> EventPublisher
pub fn publisher(&self) -> EventPublisher
Create a new publisher for this bus.
Sourcepub fn subscribe(&self, filter: EventFilter) -> EventSubscriber
pub fn subscribe(&self, filter: EventFilter) -> EventSubscriber
Subscribe to events matching the given filter.
Sourcepub fn history(&self, filter: &EventFilter) -> Vec<Event>
pub fn history(&self, filter: &EventFilter) -> Vec<Event>
Get historical events matching the given filter.
Sourcepub fn clear_history(&self)
pub fn clear_history(&self)
Clear all event history.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventBus
impl !RefUnwindSafe for EventBus
impl Send for EventBus
impl Sync for EventBus
impl Unpin for EventBus
impl UnsafeUnpin for EventBus
impl !UnwindSafe for EventBus
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> IntoMetered for T
impl<T> IntoMetered for T
Source§fn metered(self, metrics: Arc<ChannelMetrics>) -> MeteredSender<Self>
fn metered(self, metrics: Arc<ChannelMetrics>) -> MeteredSender<Self>
Wrap this sender with metrics tracking.
Source§impl<T> WithMetrics for T
impl<T> WithMetrics for T
Source§fn with_metrics(self) -> MeteredWrapper<Self>
fn with_metrics(self) -> MeteredWrapper<Self>
Wrap this channel with metrics tracking.