pub struct EventStream { /* private fields */ }Expand description
A server-sent event stream. Comments (the ready line and heartbeats) are
skipped. next returns None when the server closes the stream; open it
again with the last id to continue.
Implementations§
Source§impl EventStream
impl EventStream
Sourcepub fn last_event_id(&self) -> Option<&str>
pub fn last_event_id(&self) -> Option<&str>
The id of the last event returned, for resuming.
pub async fn next(&mut self) -> Result<Option<StreamEvent>>
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