Enum utf8::DecodeError
source · 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)>
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)