pub enum FormatError {
MalformedDocument {
format: &'static str,
detail: String,
},
PayloadTooLarge,
Read {
detail: String,
},
Encoding {
format: &'static str,
detail: String,
},
}Expand description
A failure while decoding or encoding a Serde document.
Variants§
MalformedDocument
The input is not a valid document in the named format.
Fields
PayloadTooLarge
The input stream ended the transfer because a configured size
limit was exceeded (see crate::PayloadLimitExceeded).
Read
The underlying reader failed before the document ended.
Encoding
The value failed to encode in the named format.
Implementations§
Source§impl FormatError
impl FormatError
Sourcepub fn from_read_error(error: &Error) -> Self
pub fn from_read_error(error: &Error) -> Self
Classify a decoder-side I/O failure: the payload-limit sentinel
becomes FormatError::PayloadTooLarge; everything else is a
read failure.
Trait Implementations§
Source§impl Debug for FormatError
impl Debug for FormatError
Source§impl Display for FormatError
impl Display for FormatError
Source§impl Error for FormatError
impl Error for FormatError
1.30.0 · 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 FormatError
impl RefUnwindSafe for FormatError
impl Send for FormatError
impl Sync for FormatError
impl Unpin for FormatError
impl UnsafeUnpin for FormatError
impl UnwindSafe for FormatError
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