Enum encode_unicode::error::InvalidUtf8
source · pub enum InvalidUtf8 {
FirstByte(InvalidUtf8FirstByte),
NotAContinuationByte(usize),
OverLong,
}
Expand description
Reasons why a byte sequence is not valid UTF-8, excluding invalid codepoint. In sinking precedence.
Variants§
FirstByte(InvalidUtf8FirstByte)
Something is wrong with the first byte.
NotAContinuationByte(usize)
The byte at index 1…3 should be a continuation byte, but dosesn’t fit the pattern 0b10xx_xxxx.
OverLong
There are too many leading zeros: it could be a byte shorter.
Trait Implementations§
source§impl Clone for InvalidUtf8
impl Clone for InvalidUtf8
source§fn clone(&self) -> InvalidUtf8
fn clone(&self) -> InvalidUtf8
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 Debug for InvalidUtf8
impl Debug for InvalidUtf8
source§impl Display for InvalidUtf8
impl Display for InvalidUtf8
source§impl Error for InvalidUtf8
impl Error for InvalidUtf8
source§fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
fn cause(&self) -> Option<&dyn Error>
Returns Some
if the error is a InvalidUtf8FirstByte
.
source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<InvalidUtf8> for InvalidUtf8Array
impl From<InvalidUtf8> for InvalidUtf8Array
source§fn from(error: InvalidUtf8) -> InvalidUtf8Array
fn from(error: InvalidUtf8) -> InvalidUtf8Array
Converts to this type from the input type.
source§impl From<InvalidUtf8> for InvalidUtf8Slice
impl From<InvalidUtf8> for InvalidUtf8Slice
source§fn from(error: InvalidUtf8) -> InvalidUtf8Slice
fn from(error: InvalidUtf8) -> InvalidUtf8Slice
Converts to this type from the input type.
source§impl From<InvalidUtf8FirstByte> for InvalidUtf8
impl From<InvalidUtf8FirstByte> for InvalidUtf8
source§fn from(error: InvalidUtf8FirstByte) -> InvalidUtf8
fn from(error: InvalidUtf8FirstByte) -> InvalidUtf8
Converts to this type from the input type.
source§impl PartialEq for InvalidUtf8
impl PartialEq for InvalidUtf8
source§fn eq(&self, other: &InvalidUtf8) -> bool
fn eq(&self, other: &InvalidUtf8) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for InvalidUtf8
impl Eq for InvalidUtf8
impl StructuralPartialEq for InvalidUtf8
Auto Trait Implementations§
impl Freeze for InvalidUtf8
impl RefUnwindSafe for InvalidUtf8
impl Send for InvalidUtf8
impl Sync for InvalidUtf8
impl Unpin for InvalidUtf8
impl UnwindSafe for InvalidUtf8
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: 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
)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
)