pub enum OriginRangeFetch {
Ranged {
data: Bytes,
},
NotFound,
Unsupported,
}Expand description
Result of an Origin::fetch_range_data call (ADR 037 §Origin-tier
pull-through, #823).
A range-scoped origin pull fetches the small sibling {H}.obao4 outboard
once (Origin::fetch_outboard), then fetches the requested byte span in
windows of at most crate::RANGE_PULL_WINDOW_BYTES, verifying them
against the root H before any byte is imported or served — avoiding
whole-blob origin egress to serve a byte range on a cache miss, with memory
bounded by the window rather than the span (#2065). The verifier is
the engine: one bao_tree::io::fsm::encode_ranges_validated pass on the
crate::CacheEngine::origin_range_wire path.
The optimization is best-effort: when the origin does not honor
Range, or the object is absent or shorter than the span, the adapter
returns Self::Unsupported and the engine degrades to the existing
whole-blob Origin::fetch pull. That fallback is never a
correctness or availability failure — it only forgoes the cost reduction
(ADR 037 §“Fallback is always correct”).
Variants§
Ranged
The origin served the requested byte span. data covers exactly
[req.fetch_start, req.fetch_end) (the chunk-group-aligned span the
engine asked for) and is untrusted until the engine verifies it against
H.
NotFound
The origin reported the object (data key) does not exist.
Unsupported
The range optimization is not available for this fetch — no
Range/206 support, or a span the object does not hold (a stale or
short copy). The engine degrades to a whole-blob Origin::fetch
pull. This is an expected answer, not an error. A missing {H}.obao4 is
reported by Origin::fetch_outboard, not here.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for OriginRangeFetch
impl RefUnwindSafe for OriginRangeFetch
impl Send for OriginRangeFetch
impl Sync for OriginRangeFetch
impl Unpin for OriginRangeFetch
impl UnsafeUnpin for OriginRangeFetch
impl UnwindSafe for OriginRangeFetch
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> 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