pub struct StreamEnd {
pub reason: EndReason,
pub cursor: u64,
}Expand description
Why a stream stopped, and where a resume would pick up.
Returned by ExecHandle::for_each_event and
ExecHandle::for_each_event_async so the three endings are distinguishable
without a caller having to reason about which event it last saw. That distinction is
the whole point of this module — a body that ended without an exit event was cut, and
the byte sequence alone cannot say so — and asking every caller to re-derive it from a
tally is how one of them gets it wrong and reports a truncated stream as a clean pass.
Fields§
§reason: EndReason§cursor: u64The offset a resume would pass as StreamOptions::offset.
Core’s cursor, not a count of what the callback saw. The two rules in this
module’s docs (advance only past delivered bytes, and advance past a gap) are
obeyed by the state machine below; handing the number back means a caller resuming
does not maintain a second cursor that disagrees with this one exactly when a
reconnect happened.
Trait Implementations§
impl Copy for StreamEnd
impl Eq for StreamEnd
impl StructuralPartialEq for StreamEnd
Auto Trait Implementations§
impl Freeze for StreamEnd
impl RefUnwindSafe for StreamEnd
impl Send for StreamEnd
impl Sync for StreamEnd
impl Unpin for StreamEnd
impl UnsafeUnpin for StreamEnd
impl UnwindSafe for StreamEnd
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more