pub struct EventStream { /* private fields */ }Expand description
A live event stream: a delivery adapter over committed history, not the history itself.
It does not reconnect on its own. When it ends or fails, open a new one from
EventStream::last_event_id and nothing committed in between is skipped. For a complete,
bounded read of history use the application’s event replay instead.
Implementations§
Source§impl EventStream
impl EventStream
Sourcepub fn last_event_id(&self) -> Option<&str>
pub fn last_event_id(&self) -> Option<&str>
The cursor of the last event delivered (or the one this stream resumed from).
Sourcepub async fn next(&mut self) -> Option<Result<ServerEvent>>
pub async fn next(&mut self) -> Option<Result<ServerEvent>>
The next event; None when the server closed the stream.
An authority.error event from the server ends the stream with Error::Stream.
Auto Trait Implementations§
impl !RefUnwindSafe for EventStream
impl !UnwindSafe for EventStream
impl Freeze for EventStream
impl Send for EventStream
impl Sync for EventStream
impl Unpin for EventStream
impl UnsafeUnpin 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