pub struct Error { /* private fields */ }Expand description
A minimal representation of all possible errors that can occur.
Implementations§
Source§impl Error
impl Error
Sourcepub fn end_of_file() -> Self
pub fn end_of_file() -> Self
EOF while parsing.
Sourcepub fn invalid_type(
unexpected: String,
expected: String,
pos: Option<usize>,
) -> Self
pub fn invalid_type( unexpected: String, expected: String, pos: Option<usize>, ) -> Self
A mismatch occurred between the decoded and expected value types.
Sourcepub fn invalid_value(
unexpected: String,
expected: String,
pos: Option<usize>,
) -> Self
pub fn invalid_value( unexpected: String, expected: String, pos: Option<usize>, ) -> Self
The enclosed I/O error occurred while trying to read the encoded MessagePack data.
Sourcepub fn invalid_length(
unexpected: String,
expected: String,
pos: Option<usize>,
) -> Self
pub fn invalid_length( unexpected: String, expected: String, pos: Option<usize>, ) -> Self
A decoded sequence/map did not have the enclosed expected length.
Sourcepub fn unknown_length() -> Self
pub fn unknown_length() -> Self
An encoded sequence/map did not provide a length.
Sourcepub fn number_out_of_range(pos: Option<usize>) -> Self
pub fn number_out_of_range(pos: Option<usize>) -> Self
A numeric cast failed due to an out-of-range error.
Sourcepub fn uncategorized(msg: impl Display, pos: Option<usize>) -> Self
pub fn uncategorized(msg: impl Display, pos: Option<usize>) -> Self
An otherwise uncategorized error occurred.
Sourcepub fn depth_limit_exceeded(pos: Option<usize>) -> Self
pub fn depth_limit_exceeded(pos: Option<usize>) -> Self
The depth limit was exceeded.
Sourcepub fn utf8(err: Utf8Error, pos: Option<usize>) -> Self
pub fn utf8(err: Utf8Error, pos: Option<usize>) -> Self
An encoded string could not be parsed as UTF-8.
Sourcepub fn reserved_type() -> Self
pub fn reserved_type() -> Self
Reserved type.
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 !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