Enum encode_unicode::error::InvalidUtf8[][src]

pub enum InvalidUtf8 {
    FirstByte(InvalidUtf8FirstByte),
    NotAContinuationByte(usize),
    OverLong,
}

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.

Decoding this could allow someone to input otherwise prohibited characters and sequences, such as “../”.

Trait Implementations

impl Clone for InvalidUtf8[src]

impl Copy for InvalidUtf8[src]

impl Debug for InvalidUtf8[src]

impl Display for InvalidUtf8[src]

impl Eq for InvalidUtf8[src]

impl Error for InvalidUtf8[src]

fn cause(&self) -> Option<&dyn Error>[src]

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Returns Some if the error is a InvalidUtf8FirstByte.

impl From<InvalidUtf8> for InvalidUtf8Array[src]

impl From<InvalidUtf8> for InvalidUtf8Slice[src]

impl From<InvalidUtf8FirstByte> for InvalidUtf8[src]

impl PartialEq<InvalidUtf8> for InvalidUtf8[src]

impl StructuralEq for InvalidUtf8[src]

impl StructuralPartialEq for InvalidUtf8[src]

Auto Trait Implementations

impl RefUnwindSafe for InvalidUtf8

impl Send for InvalidUtf8

impl Sync for InvalidUtf8

impl Unpin for InvalidUtf8

impl UnwindSafe for InvalidUtf8

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.