pub enum CodecError {
UnstructuredFormat {
format: Format,
backtrace: Backtrace,
},
UnexpectedDataFormat {
expected: Format,
actual: Option<DataHeader>,
backtrace: Backtrace,
},
UnsupportedDataFormat {
ordinal: FormatMetadata,
backtrace: Backtrace,
},
MissingBlobLength {
length: FormatMetadata,
},
MissingDataFields {
count: FormatMetadata,
},
Stream {
source: StreamError,
},
}
Expand description
Enumeration of errors that may occur while encoding or decoding data.
Variants§
UnstructuredFormat
An encoder was asked to encode a blob as structured data.
UnexpectedDataFormat
A header for the wrong data format was given to a decoder.
UnsupportedDataFormat
An unsupported data format ordinal was given to a decoder.
MissingBlobLength
A decoder expected to decode more blob fields’ data.
Fields
§
length: FormatMetadata
MissingDataFields
A decoder expected to decode more data fields.
Fields
§
count: FormatMetadata
Stream
An error occurred while reading or writing the underlying data stream.
Fields
§
source: StreamError
Trait Implementations§
Source§impl Debug for CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
Source§impl Error for CodecError
impl Error for CodecError
Source§impl ErrorCompat for CodecError
impl ErrorCompat for CodecError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source
. Read moreSource§impl From<StreamError> for CodecError
impl From<StreamError> for CodecError
Source§fn from(value: StreamError) -> Self
fn from(value: StreamError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CodecError
impl RefUnwindSafe for CodecError
impl Send for CodecError
impl Sync for CodecError
impl Unpin for CodecError
impl UnwindSafe for CodecError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
Source§impl<T> TryAsFormat<T> for T
impl<T> TryAsFormat<T> for T
Source§type Error = Infallible
type Error = Infallible
Source§fn try_as_format(&self) -> Result<&T, <T as TryAsFormat<T>>::Error>
fn try_as_format(&self) -> Result<&T, <T as TryAsFormat<T>>::Error>
Returns a
D
-formatted reference to the data.