Enum futf::Meaning [] [src]

pub enum Meaning {
    Whole(char),
    LeadSurrogate(u16),
    TrailSurrogate(u16),
    Prefix(usize),
    Suffix,
}

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

We found a whole codepoint.

LeadSurrogate

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

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

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

Derived Implementations

impl Hash for Meaning

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl Debug for Meaning

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Ord for Meaning

fn cmp(&self, __arg_0: &Meaning) -> Ordering

impl PartialOrd for Meaning

fn partial_cmp(&self, __arg_0: &Meaning) -> Option<Ordering>

fn lt(&self, __arg_0: &Meaning) -> bool

fn le(&self, __arg_0: &Meaning) -> bool

fn gt(&self, __arg_0: &Meaning) -> bool

fn ge(&self, __arg_0: &Meaning) -> bool

impl Eq for Meaning

impl PartialEq for Meaning

fn eq(&self, __arg_0: &Meaning) -> bool

fn ne(&self, __arg_0: &Meaning) -> bool

impl Clone for Meaning

fn clone(&self) -> Meaning

fn clone_from(&mut self, source: &Self)

impl Copy for Meaning