pub enum Data {
Bytes(Vec<u8>),
Retry,
}Expand description
WHY: Callers need to distinguish between actual data and transient “no data yet” signals when reading from TCP streams.
WHAT: Result of a single read batch — either real bytes or a retry signal.
HOW: Wraps the two possible outcomes of a non-blocking read() call
into a type-safe enum that the caller can pattern-match on.
Variants§
Bytes(Vec<u8>)
A batch of bytes successfully read from the source.
Retry
Yielded on WouldBlock, TimedOut, or Ok(0)-when-not-EOF.
Signals the caller should retry (poll again later).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnsafeUnpin for Data
impl UnwindSafe for Data
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