pub enum Utf8Error {
Truncated,
UnexpectedContinuation,
InvalidLeadByte,
SurrogateCodepoint,
OverlongEncoding,
CodepointOutOfRange,
InvalidContinuation,
}Expand description
UTF-8 validation errors.
Variants§
Truncated
Truncated multi-byte sequence (a continuation byte is missing at the end).
UnexpectedContinuation
Continuation byte without a lead byte (10xxxxxx isolated).
InvalidLeadByte
The lead byte is invalid (e.g. 0xC0, 0xC1, 0xF5-0xFF).
SurrogateCodepoint
Surrogate codepoint U+D800..=U+DFFF.
OverlongEncoding
Overlong encoding (e.g. 0xC0 0x80 for NUL).
CodepointOutOfRange
Codepoint > U+10FFFF.
InvalidContinuation
The continuation byte is not 10xxxxxx.
Trait Implementations§
impl Copy for Utf8Error
impl Eq for Utf8Error
Source§impl Error for Utf8Error
Available on crate feature std only.
impl Error for Utf8Error
Available on crate feature
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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 StructuralPartialEq for Utf8Error
Auto Trait Implementations§
impl Freeze for Utf8Error
impl RefUnwindSafe for Utf8Error
impl Send for Utf8Error
impl Sync for Utf8Error
impl Unpin for Utf8Error
impl UnsafeUnpin for Utf8Error
impl UnwindSafe for Utf8Error
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