pub struct EventStream { /* private fields */ }Expand description
An async stream of events for one or more watchers.
All session events flow through one broadcast channel; each EventStream
filters to its subscribed watcher names, so merge is just a name union.
Implementations§
Source§impl EventStream
impl EventStream
Sourcepub async fn next(&mut self) -> Option<Event>
pub async fn next(&mut self) -> Option<Event>
Next event, or None when the session has shut down.
If this consumer lags behind the broadcast buffer, missed events are
skipped silently and the stream continues with the newest.
Sourcepub fn merge(self, other: EventStream) -> EventStream
pub fn merge(self, other: EventStream) -> EventStream
Combine two streams into one that yields events from both.
Both streams must originate from the same Session: the merged stream
keeps only self’s receiver and unions the name filters, which is
correct because all of a session’s events flow through one broadcast
channel. Merging streams from different sessions would silently drop
the other session’s events.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventStream
impl RefUnwindSafe for EventStream
impl Send for EventStream
impl Sync for EventStream
impl Unpin for EventStream
impl UnsafeUnpin for EventStream
impl UnwindSafe for EventStream
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