pub enum Meaning {
Whole(char),
LeadSurrogate(u16),
TrailSurrogate(u16),
Prefix(usize),
Suffix,
}
Expand description
Meaning of a complete or partial UTF-8 codepoint.
Not all checking is performed eagerly. That is, a codepoint Prefix
or
Suffix
may in reality have no valid completion.
Variants§
Whole(char)
We found a whole codepoint.
LeadSurrogate(u16)
We found something that isn’t a valid Unicode codepoint, but
it would correspond to a UTF-16 leading surrogate code unit,
i.e. a value in the range U+D800
- U+DBFF
.
The argument is the code unit’s 10-bit index within that range.
These are found in UTF-8 variants such as CESU-8 and WTF-8.
TrailSurrogate(u16)
We found something that isn’t a valid Unicode codepoint, but
it would correspond to a UTF-16 trailing surrogate code unit,
i.e. a value in the range U+DC00
- U+DFFF
.
The argument is the code unit’s 10-bit index within that range.
These are found in UTF-8 variants such as CESU-8 and WTF-8.
Prefix(usize)
We found only a prefix of a codepoint before the buffer ended.
Includes the number of additional bytes needed.
Suffix
We found only a suffix of a codepoint before running off the start of the buffer.
Up to 3 more bytes may be needed.
Trait Implementations§
source§impl Ord for Meaning
impl Ord for Meaning
source§impl PartialOrd for Meaning
impl PartialOrd for Meaning
impl Copy for Meaning
impl Eq for Meaning
impl StructuralPartialEq for Meaning
Auto Trait Implementations§
impl Freeze for Meaning
impl RefUnwindSafe for Meaning
impl Send for Meaning
impl Sync for Meaning
impl Unpin for Meaning
impl UnwindSafe for Meaning
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
)