pub enum SchemaError {
CdrRead(DeserError),
CdrWrite(SerError),
BufferTooSmall,
Truncated,
Malformed,
Unsupported(&'static str),
}Expand description
What can go wrong in a schema-driven encode or decode.
Deliberately separate from SerError / DeserError: those describe the
CDR side of a transcode, and a provider’s own wire has failure modes CDR
does not (a truncated foreign buffer, a length prefix that disagrees with
the schema).
Variants§
CdrRead(DeserError)
The CDR side failed while reading.
CdrWrite(SerError)
The CDR side failed while writing.
BufferTooSmall
The foreign buffer is too small to hold the encoding.
Truncated
The foreign buffer ended in the middle of a value.
Malformed
The foreign buffer disagrees with the schema — a length prefix past a declared bound, a bool that is not 0 or 1, invalid UTF-8.
Unsupported(&'static str)
A schema shape this walk cannot express, with the reason.
Never a silent skip: a field that cannot be walked ends the encode, because a partial message on the wire is worse than no message.
Trait Implementations§
Source§impl Clone for SchemaError
impl Clone for SchemaError
Source§fn clone(&self) -> SchemaError
fn clone(&self) -> SchemaError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SchemaError
Source§impl Debug for SchemaError
impl Debug for SchemaError
Source§impl Display for SchemaError
impl Display for SchemaError
impl Eq for SchemaError
Source§impl From<DeserError> for SchemaError
impl From<DeserError> for SchemaError
Source§fn from(e: DeserError) -> Self
fn from(e: DeserError) -> Self
Source§impl From<SerError> for SchemaError
impl From<SerError> for SchemaError
Source§impl PartialEq for SchemaError
impl PartialEq for SchemaError
Source§fn eq(&self, other: &SchemaError) -> bool
fn eq(&self, other: &SchemaError) -> bool
self and other values to be equal, and is used by ==.