pub enum InvalidUtf8Slice {
Utf8(InvalidUtf8),
Codepoint(InvalidCodepoint),
TooShort(usize),
}
Expand description
Reasons why a byte slice is not valid UTF-8, in sinking precedence.
Variants§
Utf8(InvalidUtf8)
Something is certainly wrong with the first byte.
Codepoint(InvalidCodepoint)
The encoded codepoint is invalid:
TooShort(usize)
The slice is too short; n bytes was required.
Trait Implementations§
Source§impl Clone for InvalidUtf8Slice
impl Clone for InvalidUtf8Slice
Source§fn clone(&self) -> InvalidUtf8Slice
fn clone(&self) -> InvalidUtf8Slice
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 InvalidUtf8Slice
impl Debug for InvalidUtf8Slice
Source§impl Display for InvalidUtf8Slice
impl Display for InvalidUtf8Slice
Source§impl Error for InvalidUtf8Slice
impl Error for InvalidUtf8Slice
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl From<InvalidCodepoint> for InvalidUtf8Slice
impl From<InvalidCodepoint> for InvalidUtf8Slice
Source§fn from(error: InvalidCodepoint) -> InvalidUtf8Slice
fn from(error: InvalidCodepoint) -> InvalidUtf8Slice
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 PartialEq for InvalidUtf8Slice
impl PartialEq for InvalidUtf8Slice
impl Copy for InvalidUtf8Slice
impl Eq for InvalidUtf8Slice
impl StructuralPartialEq for InvalidUtf8Slice
Auto Trait Implementations§
impl Freeze for InvalidUtf8Slice
impl RefUnwindSafe for InvalidUtf8Slice
impl Send for InvalidUtf8Slice
impl Sync for InvalidUtf8Slice
impl Unpin for InvalidUtf8Slice
impl UnwindSafe for InvalidUtf8Slice
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
)