pub enum DecodeError<'a> {
Invalid {
valid_prefix: &'a str,
invalid_sequence: &'a [u8],
remaining_input: &'a [u8],
},
Incomplete {
valid_prefix: &'a str,
incomplete_suffix: Incomplete,
},
}
Variants§
Invalid
In lossy decoding insert valid_prefix
, then "\u{FFFD}"
,
then call decode()
again with remaining_input
.
Incomplete
Call the incomplete_suffix.try_complete
method with more input when available.
If no more input is available, this is an invalid byte sequence.
Trait Implementations§
Source§impl<'a> Clone for DecodeError<'a>
impl<'a> Clone for DecodeError<'a>
Source§fn clone(&self) -> DecodeError<'a>
fn clone(&self) -> DecodeError<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for DecodeError<'a>
impl<'a> Debug for DecodeError<'a>
Source§impl<'a> Display for DecodeError<'a>
impl<'a> Display for DecodeError<'a>
Source§impl<'a> Error for DecodeError<'a>
impl<'a> Error for DecodeError<'a>
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()
impl<'a> Copy for DecodeError<'a>
Auto Trait Implementations§
impl<'a> Freeze for DecodeError<'a>
impl<'a> RefUnwindSafe for DecodeError<'a>
impl<'a> Send for DecodeError<'a>
impl<'a> Sync for DecodeError<'a>
impl<'a> Unpin for DecodeError<'a>
impl<'a> UnwindSafe for DecodeError<'a>
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