pub struct OriginRangeWire { /* private fields */ }Expand description
The header-less interleaved bao wire (ADR 038) for one range of a blob,
verified against the root H and produced window by window out of an
origin. Returned by crate::CacheEngine::origin_range_wire.
A background task runs the encode and holds a range-pull permit until it
ends. Self::next_chunk yields the wire in order, then either one
terminal Err or None:
Some(Err(_))— the encode stopped:CacheError::VerifyFailedfor a window that fails verification againstH,CacheError::OriginErrorfor an origin that stops serving or a task that is cancelled,CacheError::Internalfor a code bug: a reader invariant break, or a panic in the encode, whose message the error carries. The wire is incomplete.Nonewith noErrbefore it — the encode completed; the wire is whole.
Dropping the wire aborts the encode and releases its permit.
Implementations§
Source§impl OriginRangeWire
impl OriginRangeWire
Sourcepub async fn next_chunk(&mut self) -> Option<CacheResult<Bytes>>
pub async fn next_chunk(&mut self) -> Option<CacheResult<Bytes>>
The next chunk of wire, in order. After the last chunk it yields one
Some(Err(_)) if the encode stopped on a fault, and None otherwise
(see the type docs). Every later call yields None.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OriginRangeWire
impl RefUnwindSafe for OriginRangeWire
impl Send for OriginRangeWire
impl Sync for OriginRangeWire
impl Unpin for OriginRangeWire
impl UnsafeUnpin for OriginRangeWire
impl UnwindSafe for OriginRangeWire
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
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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.