pub struct ResumableStream<'client> { /* private fields */ }Expand description
A read that reconnects itself, so a dropped stream costs a round trip rather than the session.
Implementations§
Source§impl ResumableStream<'_>
impl ResumableStream<'_>
Sourcepub async fn next_event(&mut self) -> Result<Option<SseEvent>, HttpClientError>
pub async fn next_event(&mut self) -> Result<Option<SseEvent>, HttpClientError>
The next event, across as many reconnects as the budget allows.
§Errors
HttpClientError::ResumeExhausted once the reconnect budget is spent,
carrying how far the read got and why the last attempt ended. A
non-transient failure — a malformed frame, a media type this client
cannot read, an unparseable session id — is returned as itself, because
reconnecting would produce the same one.
Sourcepub const fn delivered(&self) -> u64
pub const fn delivered(&self) -> u64
How many events this read has delivered, across every connection.
Sourcepub const fn reconnects(&self) -> u32
pub const fn reconnects(&self) -> u32
How many reconnects have been used.
Trait Implementations§
Auto Trait Implementations§
impl<'client> !RefUnwindSafe for ResumableStream<'client>
impl<'client> !UnwindSafe for ResumableStream<'client>
impl<'client> Freeze for ResumableStream<'client>
impl<'client> Send for ResumableStream<'client>
impl<'client> Sync for ResumableStream<'client>
impl<'client> Unpin for ResumableStream<'client>
impl<'client> UnsafeUnpin for ResumableStream<'client>
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