pub struct Fetch<C> {
pub data: C,
pub kind: FetchKind,
pub epoch: u64,
}Expand description
Fetch result from a worker source.
Fields§
§data: CThe data chunk (ignored for non-Data kinds).
kind: FetchKindMarker kind.
epoch: u64Epoch for seek invalidation (0 if unused).
Implementations§
Source§impl<C> Fetch<C>
impl<C> Fetch<C>
Sourcepub fn new(data: C, is_eof: bool, epoch: u64) -> Self
pub fn new(data: C, is_eof: bool, epoch: u64) -> Self
Create a fetch result from the legacy is_eof: bool shape.
is_eof = true maps to FetchKind::NaturalEof; false to
FetchKind::Data. Prefer the explicit constructors below.
Sourcepub fn failure(data: C, epoch: u64) -> Self
pub fn failure(data: C, epoch: u64) -> Self
Explicit failure marker (distinct from natural EOF).
Sourcepub fn into_inner(self) -> C
pub fn into_inner(self) -> C
Consume and return the inner data.
Sourcepub fn is_eof(&self) -> bool
pub fn is_eof(&self) -> bool
True iff this is a natural-EOF marker. Does not cover
Failure — callers must use is_failure() or is_terminal()
for the broader “end of stream for any reason” check.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
True iff this is any terminal marker (natural EOF or failure).
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Fetch<C>where
C: Freeze,
impl<C> RefUnwindSafe for Fetch<C>where
C: RefUnwindSafe,
impl<C> Send for Fetch<C>where
C: Send,
impl<C> Sync for Fetch<C>where
C: Sync,
impl<C> Unpin for Fetch<C>where
C: Unpin,
impl<C> UnsafeUnpin for Fetch<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Fetch<C>where
C: UnwindSafe,
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