pub enum StreamReadOutcome {
Bytes {
count: NonZeroUsize,
byte_position: u64,
},
Pending(PendingReason),
Eof {
byte_position: u64,
},
}Expand description
Outcome of a Stream::try_read call.
Mirrors the ReadOutcome shape from
Source::read_at, but extends each variant
with the authoritative byte_position from the stream’s
Timeline for callers that don’t want to read it back themselves.
Bytes carries a NonZeroUsize count — the type system
guarantees forward progress.
Variants§
Bytes
Stream produced count bytes. byte_position is the new byte
offset after the read.
Pending(PendingReason)
No progress this call. See PendingReason for the precise
cause and required caller action.
Eof
Natural end of stream. byte_position is the offset where EOF
was observed (typically the source length).
Trait Implementations§
Source§impl Clone for StreamReadOutcome
impl Clone for StreamReadOutcome
Source§fn clone(&self) -> StreamReadOutcome
fn clone(&self) -> StreamReadOutcome
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamReadOutcome
impl Debug for StreamReadOutcome
Source§impl PartialEq for StreamReadOutcome
impl PartialEq for StreamReadOutcome
Source§fn eq(&self, other: &StreamReadOutcome) -> bool
fn eq(&self, other: &StreamReadOutcome) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for StreamReadOutcome
impl Eq for StreamReadOutcome
impl StructuralPartialEq for StreamReadOutcome
Auto Trait Implementations§
impl Freeze for StreamReadOutcome
impl RefUnwindSafe for StreamReadOutcome
impl Send for StreamReadOutcome
impl Sync for StreamReadOutcome
impl Unpin for StreamReadOutcome
impl UnsafeUnpin for StreamReadOutcome
impl UnwindSafe for StreamReadOutcome
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