[][src]Trait encode_unicode::U8UtfExt

pub trait U8UtfExt {
    fn extra_utf8_bytes(self) -> Result<usize, InvalidUtf8FirstByte>;
fn extra_utf8_bytes_unchecked(self) -> usize; }

Methods for working with u8s 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: ContinuationByte
  • 240..: 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)

Loading content...

Implementations on Foreign Types

impl U8UtfExt for u8[src]

Loading content...

Implementors

Loading content...