[src]

Enum std::str::UTF16Item

pub enum UTF16Item {
    ScalarValue(char),
    LoneSurrogate(u16),
}

The possibilities for values decoded from a u16 stream.

Variants

ScalarValue

A valid codepoint.

LoneSurrogate

An invalid surrogate without its pair.

Methods

impl UTF16Item

fn to_char_lossy(&self) -> char

Convert self to a char, taking LoneSurrogates to the replacement character (U+FFFD).

Trait Implementations

Derived Implementations

impl Show for UTF16Item

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

Formats the value using the given formatter.

impl Clone for UTF16Item

fn clone(&self) -> UTF16Item

Returns a copy of the value. The contents of owned pointers are copied to maintain uniqueness, while the contents of managed pointers are not copied.

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

Perform copy-assignment from source.

a.clone_from(&b) is equivalent to a = b.clone() in functionality, but can be overridden to reuse the resources of a to avoid unnecessary allocations.

impl TotalEq for UTF16Item

fn assert_receiver_is_total_eq(&self)

impl Eq for UTF16Item

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

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