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 LoneSurrogate
s to the
replacement character (U+FFFD).
Trait Implementations
Derived Implementations
impl Show for UTF16Item
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.