#[non_exhaustive]pub struct BlobTooLarge {
pub reached: u64,
pub ceiling: u64,
}Expand description
Typed sentinel for a pull aborted because the bytes that ACTUALLY arrived
crossed the buyer’s max_blob_size_bytes ceiling (#1895). The peer’s signed
total_bytes claim never drives a refusal — it is peer-controlled and
unverified (StreamResponse::validate() does not bound it) — so the ceiling
binds on cumulative RECEIVED, BLAKE3-verified bytes instead. Returned (not a
bare string) so the pull orchestrator can downcast_ref and classify it as a
buyer-side policy rejection — distinct from a hash mismatch or an unreachable
peer — rather than mis-attributing it to the provider’s reputation. Display
carries BlobTooLarge so logs and the requester tests can match on it.
Units. reached and ceiling are ALWAYS the same unit within one error —
the comparison at each enforcement site is apples-to-apples — but that unit
differs by site, so neither field is a raw max_blob_size_bytes config value
across all call sites. The receive loop ([UpstreamPull::next_chunk]) meters bao
WIRE bytes (content plus interleaved proof, ADR 038) and compares against the
wire size of a ceiling-sized blob. The gap-driven driver (fill_gap) meters
CONTENT bytes (the store’s delivered frontier) and the resume-offset guard in
[open_progressive_pull] meters a CONTENT offset, both against the configured
max_blob_size_bytes directly. [acquire] meters CONTENT bytes against
[AcquireEnv::max_blob_bytes]: it clamps a size claim to the cap and
reports a blob whose bytes run past it once every byte below the cap is
present and no leg proved a size within it. Every one is a faithful “the
byte position crossed the ceiling” report.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.reached: u64The byte position that crossed ceiling — wire bytes taken off the stream
(receive loop), the store’s content frontier (gap-driven driver), or a
content resume offset already past it. Same unit as ceiling (see the
type’s Units note).
ceiling: u64The ceiling reached crossed, in the same unit as reached.
Trait Implementations§
Source§impl Debug for BlobTooLarge
impl Debug for BlobTooLarge
Source§impl Display for BlobTooLarge
impl Display for BlobTooLarge
Source§impl Error for BlobTooLarge
impl Error for BlobTooLarge
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for BlobTooLarge
impl RefUnwindSafe for BlobTooLarge
impl Send for BlobTooLarge
impl Sync for BlobTooLarge
impl Unpin for BlobTooLarge
impl UnsafeUnpin for BlobTooLarge
impl UnwindSafe for BlobTooLarge
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 moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.