pub enum Utf8ParserError {
InvalidByte(u8),
InvalidChar(u32),
UnexpectedStartByte(u8),
UnexpectedContinuationByte(u8),
OverlongEncoding,
}
Expand description
Error type used for the utf8-parser
crate
Variants§
InvalidByte(u8)
Encountered an invalid byte. This is a byte that’s invalid no matter the context.
InvalidChar(u32)
Found a code point that’s not valid UTF-8.
UnexpectedStartByte(u8)
Found a start byte in an unexpected place
UnexpectedContinuationByte(u8)
Found a continuation byte in an unexpected place
OverlongEncoding
Represented a valid code point in a longer form than necessary.
From Wikipedia:
The standard specifies that the correct encoding of a code point uses only the minimum number of bytes required to hold the significant bits of the code point. Longer encodings are called overlong and are not valid UTF-8 representations of the code point. This rule maintains a one-to-one correspondence between code points and their valid encodings, so that there is a unique valid encoding for each code point. This ensures that string comparisons and searches are well-defined.
Trait Implementations§
source§impl Clone for Utf8ParserError
impl Clone for Utf8ParserError
source§fn clone(&self) -> Utf8ParserError
fn clone(&self) -> Utf8ParserError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Utf8ParserError
impl Debug for Utf8ParserError
source§impl Display for Utf8ParserError
impl Display for Utf8ParserError
source§impl Error for Utf8ParserError
impl Error for Utf8ParserError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl PartialEq for Utf8ParserError
impl PartialEq for Utf8ParserError
impl Copy for Utf8ParserError
impl Eq for Utf8ParserError
impl StructuralPartialEq for Utf8ParserError
Auto Trait Implementations§
impl Freeze for Utf8ParserError
impl RefUnwindSafe for Utf8ParserError
impl Send for Utf8ParserError
impl Sync for Utf8ParserError
impl Unpin for Utf8ParserError
impl UnwindSafe for Utf8ParserError
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
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)
clone_to_uninit
)