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
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§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
)