pub enum CodecError {
MissingPrefix {
prefix: String,
},
InvalidDigit {
radix: u32,
index: usize,
character: char,
},
InvalidLength {
context: &'static str,
expected: String,
actual: usize,
},
InvalidEscape {
index: usize,
escape: String,
reason: String,
},
InvalidCharacter {
index: usize,
character: char,
reason: String,
},
InvalidInput {
codec: &'static str,
reason: String,
},
InvalidUtf8 {
source: FromUtf8Error,
},
}Expand description
Error returned by codec operations.
Variants§
MissingPrefix
A configured prefix was required but missing.
InvalidDigit
Input contained a digit that is invalid for the requested radix.
Fields
InvalidLength
Input length does not satisfy a codec requirement.
Fields
InvalidEscape
Input contained a malformed or unsupported escape sequence.
Fields
InvalidCharacter
Input contained a character that cannot appear in that context.
Fields
InvalidInput
Input was rejected by a codec-specific validator.
Fields
InvalidUtf8
Decoded bytes were not valid UTF-8.
Fields
§
source: FromUtf8ErrorUnderlying UTF-8 conversion error.
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§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()
Source§impl From<FromUtf8Error> for CodecError
impl From<FromUtf8Error> for CodecError
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> 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 UnsafeUnpin for CodecError
impl UnwindSafe for CodecError
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