#[non_exhaustive]pub enum DecodingProblem {
InvalidCodePoint(usize, &'static Location<'static>),
InvalidByte(u8, &'static Location<'static>),
UnexpectedEndOfData(&'static Location<'static>),
}
Expand description
Enum for possible decoding problems that can occur.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidCodePoint(usize, &'static Location<'static>)
Decoding try to create a character that is not valid in UTF-8.
InvalidByte(u8, &'static Location<'static>)
Invalid byte sequence.
UnexpectedEndOfData(&'static Location<'static>)
Decoding failed due to unexpected end of data, .i.e, it requires more data to fully decode.
Trait Implementations§
Source§impl Debug for DecodingProblem
impl Debug for DecodingProblem
Source§impl Display for DecodingProblem
impl Display for DecodingProblem
Source§impl Error for DecodingProblem
impl Error for DecodingProblem
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()
Source§impl From<DecodingProblem> for Error
impl From<DecodingProblem> for Error
Source§fn from(source: DecodingProblem) -> Self
fn from(source: DecodingProblem) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DecodingProblem
impl RefUnwindSafe for DecodingProblem
impl Send for DecodingProblem
impl Sync for DecodingProblem
impl Unpin for DecodingProblem
impl UnwindSafe for DecodingProblem
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