pub enum BufferError {
UnknownField {
name: String,
},
TypeMismatch {
name: String,
declared: &'static str,
requested: &'static str,
},
BufferTooSmall {
have: usize,
need: usize,
},
ValueTooLarge {
name: String,
len: usize,
},
MalformedPayload {
name: String,
reason: &'static str,
},
}Expand description
Failure modes when writing / reading typed fields against a buffer.
Variants§
UnknownField
The requested field name does not appear in the offset table. Indicates a schema-drift bug or a typo at the call site.
TypeMismatch
The requested write / read type does not match the field’s
declared type. Writing an i64 to a Bool slot would corrupt
the layout for adjacent fields, so this surfaces as a hard
error rather than a silent reinterpret.
Fields
BufferTooSmall
The buffer is shorter than the offset table’s root_size.
Always indicates the buffer was truncated mid-flight (e.g. an
out_buf the wasm module didn’t fully fill).
Fields
ValueTooLarge
A pointer-indirect payload (String / List<Int>) is larger than
the u32 length prefix can describe. Phase 2.c caps each
payload at u32::MAX bytes / elements; longer values surface
here rather than overflow silently.
Fields
MalformedPayload
A pointer-indirect read tripped over a malformed tail-area
payload — the length prefix points beyond the buffer end, the
pointer is null when the schema expects a value, or the
utf-8 bytes inside a String payload are invalid.
Trait Implementations§
Source§impl Clone for BufferError
impl Clone for BufferError
Source§fn clone(&self) -> BufferError
fn clone(&self) -> BufferError
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 BufferError
impl Debug for BufferError
Source§impl Display for BufferError
impl Display for BufferError
impl Eq for BufferError
Source§impl Error for BufferError
impl Error for BufferError
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 BufferError
impl PartialEq for BufferError
Source§fn eq(&self, other: &BufferError) -> bool
fn eq(&self, other: &BufferError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BufferError
Auto Trait Implementations§
impl Freeze for BufferError
impl RefUnwindSafe for BufferError
impl Send for BufferError
impl Sync for BufferError
impl Unpin for BufferError
impl UnsafeUnpin for BufferError
impl UnwindSafe for BufferError
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