pub enum VerifyError {
DegenerateRegion {
start: usize,
end: usize,
},
BufferShorterThanRegion {
have: usize,
end: usize,
},
FixedSlotOutOfRegion {
field: String,
offset: usize,
size: usize,
start: usize,
end: usize,
},
OutOfRegion {
field: String,
what: &'static str,
offset: usize,
len: usize,
start: usize,
end: usize,
},
SpanOverflow {
field: String,
what: &'static str,
},
UnsupportedType {
field: String,
ty: &'static str,
},
NoRegion {
field: String,
what: &'static str,
offset: usize,
len: usize,
},
DepthExceeded {
field: String,
depth: usize,
},
}Expand description
Why a verifier walk rejected a buffer. Every variant names the field (and where useful the offending offset / span) so a host can surface a precise diagnostic. The verifier returns these instead of reading out of bounds or panicking.
Variants§
DegenerateRegion
A Region was constructed with start > end.
BufferShorterThanRegion
The byte slice handed to the verifier is shorter than the
region’s end — the caller’s region bounds don’t fit the data.
FixedSlotOutOfRegion
A fixed-area slot (or the root_size window) does not fit inside
the region. Indicates a truncated record or a wrong region base.
Fields
OutOfRegion
A pointer-indirect offset (a u32 slot value, a list-entry
pointer, a length prefix, or a payload span) escapes the region.
This is the cross-region / out-of-bounds catch.
Fields
SpanOverflow
A usize add overflowed while computing a span end — a hostile
or corrupt buffer carrying a near-u32::MAX offset / length.
UnsupportedType
The schema named a type the verifier does not model (it should never reach here — the layout pass rejects unsupported types first — but we surface it loudly rather than skip the check).
NoRegion
A multi-region walk followed a pointer whose arena-absolute span
[offset, offset+len) fits inside no arena region (or starts
in one region but runs past its end). The cross-region catch: a
pointer must land fully inside exactly one of const / in / out /
scratch, never between or past them.
Fields
DepthExceeded
A recursion-depth guard tripped: the schema nests deeper than the verifier’s bound. Protects against a hand-built schema that recurses without bound (the runtime schemas are acyclic, but a verifier must not be DoS-able by a hostile layout).
Trait Implementations§
Source§impl Clone for VerifyError
impl Clone for VerifyError
Source§fn clone(&self) -> VerifyError
fn clone(&self) -> VerifyError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VerifyError
impl Debug for VerifyError
Source§impl Display for VerifyError
impl Display for VerifyError
impl Eq for VerifyError
Source§impl Error for VerifyError
impl Error for VerifyError
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()
Source§impl PartialEq for VerifyError
impl PartialEq for VerifyError
Source§fn eq(&self, other: &VerifyError) -> bool
fn eq(&self, other: &VerifyError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VerifyError
Auto Trait Implementations§
impl Freeze for VerifyError
impl RefUnwindSafe for VerifyError
impl Send for VerifyError
impl Sync for VerifyError
impl Unpin for VerifyError
impl UnsafeUnpin for VerifyError
impl UnwindSafe for VerifyError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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