Primitive Type char [-] [+]

Character manipulation (char type, Unicode Scalar Value)

This module provides the CharExt trait, as well as its implementation for the primitive char type, in order to allow basic character manipulation.

A char actually represents a Unicode Scalar Value, as it can contain any Unicode code point except high-surrogate and low-surrogate code points.

As such, only values in the ranges [0x0,0xD7FF] and [0xE000,0x10FFFF] (inclusive) are allowed. A char can always be safely cast to a u32; however the converse is not always true due to the above range limits and, as such, should be performed via the from_u32 function.

Trait Implementations

impl PartialEq<char> for char

fn eq(&self, other: &char) -> bool

fn ne(&self, other: &char) -> bool

fn ne(&self, &char) -> bool

impl Eq for char

fn assert_receiver_is_total_eq(&self)

impl PartialOrd<char> for char

fn partial_cmp(&self, other: &char) -> Option<Ordering>

fn lt(&self, other: &char) -> bool

fn le(&self, other: &char) -> bool

fn ge(&self, other: &char) -> bool

fn gt(&self, other: &char) -> bool

fn lt(&self, &char) -> bool

fn le(&self, &char) -> bool

fn gt(&self, &char) -> bool

fn ge(&self, &char) -> bool

impl Ord for char

fn cmp(&self, other: &char) -> Ordering

impl Clone for char

fn clone(&self) -> char

Return a deep copy of the value.

fn clone_from(&mut self, &char)

impl Default for char

fn default() -> char

impl CharExt for char

fn is_digit(self, radix: u32) -> bool

fn to_digit(self, radix: u32) -> Option<u32>

fn escape_unicode(self) -> EscapeUnicode

fn escape_default(self) -> EscapeDefault

fn len_utf8(self) -> usize

fn len_utf16(self) -> usize

fn encode_utf8(self, dst: &mut [u8]) -> Option<usize>

fn encode_utf16(self, dst: &mut [u16]) -> Option<usize>

impl CharEq for char

fn matches(&mut self, c: char) -> bool

fn only_ascii(&self) -> bool

impl Hash for char

fn hash<H>(&self, state: &mut H) where H: Hasher

fn hash_slice<H>(&[char], &mut H) where H: Hasher, char: Sized

impl Debug for char

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl Display for char

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl CharExt for char

fn is_digit(self, radix: u32) -> bool

fn to_digit(self, radix: u32) -> Option<u32>

fn escape_unicode(self) -> EscapeUnicode

fn escape_default(self) -> EscapeDefault

fn len_utf8(self) -> usize

fn len_utf16(self) -> usize

fn encode_utf8(self, dst: &mut [u8]) -> Option<usize>

fn encode_utf16(self, dst: &mut [u16]) -> Option<usize>

fn is_alphabetic(self) -> bool

fn is_xid_start(self) -> bool

fn is_xid_continue(self) -> bool

fn is_lowercase(self) -> bool

fn is_uppercase(self) -> bool

fn is_whitespace(self) -> bool

fn is_alphanumeric(self) -> bool

fn is_control(self) -> bool

fn is_numeric(self) -> bool

fn to_lowercase(self) -> char

fn to_uppercase(self) -> char

fn width(self, is_cjk: bool) -> Option<usize>

impl AsciiExt for char

type Owned = char

fn is_ascii(&self) -> bool

fn to_ascii_uppercase(&self) -> char

fn to_ascii_lowercase(&self) -> char

fn eq_ignore_ascii_case(&self, other: &char) -> bool

fn make_ascii_uppercase(&mut self)

fn make_ascii_lowercase(&mut self)

impl Rand for char

fn rand<R>(rng: &mut R) -> char where R: Rng