pub enum MiscCodecError {
Incomplete {
required: usize,
available: usize,
},
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§
Incomplete
Input ended before a complete codec value was available.
Fields
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 MiscCodecError
impl Debug for MiscCodecError
Source§impl Display for MiscCodecError
impl Display for MiscCodecError
Source§impl Error for MiscCodecError
impl Error for MiscCodecError
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 MiscCodecError
impl From<FromUtf8Error> for MiscCodecError
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 MiscCodecError
impl RefUnwindSafe for MiscCodecError
impl Send for MiscCodecError
impl Sync for MiscCodecError
impl Unpin for MiscCodecError
impl UnsafeUnpin for MiscCodecError
impl UnwindSafe for MiscCodecError
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