pub enum Error {
Truncated {
offset: usize,
needed: usize,
},
Type {
expected: &'static str,
found: &'static str,
offset: usize,
},
IntRange {
value: i128,
target: &'static str,
},
Utf8 {
offset: usize,
},
Tag {
expected: &'static str,
found: String,
},
MissingField(&'static str),
TrailingBytes(usize),
Invalid(String),
Field {
field: &'static str,
source: Box<Error>,
},
}Expand description
A message that does not match the schema, or is not valid msgpack.
Variants§
Truncated
The input ended inside a value.
Fields
Type
A value of a different msgpack type than the schema allows.
Fields
IntRange
An integer outside the range of the schema’s type.
Utf8
A string that is not valid UTF-8.
Tag
A tagged struct whose tag names a different message type.
MissingField(&'static str)
A struct without a value for a field that has no default.
TrailingBytes(usize)
Bytes left in the primary frame after the top-level value.
Invalid(String)
A value the schema rejects for a reason other than its type.
Field
An error inside a named field, kept with the field name for context.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
Mutably borrows from an owned value. Read more