#[non_exhaustive]pub struct BlobTooLarge {
pub reached: u64,
pub ceiling: u64,
}Expand description
Typed sentinel for a pull ended by the buyer’s max_blob_size_bytes cap
(#1895). The cap bounds how many bytes of one blob the buyer holds, not which
offsets it reads: a range anywhere in a blob larger than the cap lands while
the bytes held stay within it. 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 cap binds on
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. The receive loop ([UpstreamPull::next_chunk]) meters bao
WIRE bytes (content plus interleaved proof, ADR 038) one stream received,
against the wire size of the cap’s worth of content from the stream’s
offset. The gap-driven driver (fill_gap) meters the CONTENT bytes the store
would hold once the gap lands, against max_blob_size_bytes, and ends before
it opens a leg that could only add bytes past the cap. [acquire] meters the
CONTENT bytes the store holds against [AcquireEnv::max_blob_bytes].
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 count past ceiling — wire bytes one stream received (receive
loop), or content bytes the store holds or would hold for the blob
(driver, [acquire]). Same unit as ceiling (see the type’s Units
note).
ceiling: u64The cap reached passed, 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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