Trait encode_unicode::U8UtfExt
[−]
[src]
pub trait U8UtfExt { fn extra_utf8_bytes(self) -> Result<usize, InvalidUtf8FirstByte>; fn extra_utf8_bytes_unchecked(self) -> usize; }
Methods for working with u8
s UTF-8.
Required Methods
fn extra_utf8_bytes(self) -> Result<usize, InvalidUtf8FirstByte>
How many more bytes will you need to complete this codepoint? Failures:
128..192
: ContinuationByte240..
: TooLongSequence
fn extra_utf8_bytes_unchecked(self) -> usize
How many more bytes will you need to complete this codepoint?
Assumes that self is a valid UTF-8 start.
Returns self.not().leading_zeros().saturating_sub(1)
Implementors
impl U8UtfExt for u8