Primitive Type char

Character manipulation (char type, Unicode Scalar Value)

This module provides the Char 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 Rand for char

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

impl AsciiCast<Ascii> for char

unsafe fn to_ascii_nocheck(&self) -> Ascii

fn is_ascii(&self) -> bool

fn to_ascii(&self) -> T

fn to_ascii_opt(&self) -> Option<T>

impl PartialEq 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 for char

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 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 Char for char

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_digit(&self) -> bool

fn is_digit_radix(&self, radix: uint) -> bool

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

fn to_lowercase(&self) -> char

fn to_uppercase(&self) -> char

fn from_digit(num: uint, radix: uint) -> Option<char>

fn escape_unicode(&self, f: |char|)

fn escape_default(&self, f: |char|)

fn len_utf8_bytes(&self) -> uint

fn encode_utf8(&self, dst: &'a mut [u8]) -> uint

fn encode_utf16(&self, dst: &mut [u16]) -> uint

impl CharEq for char

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

fn only_ascii(&self) -> bool

impl Char for char

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

impl<'a> Show for char

fn fmt<'a>(&self, f: &mut Formatter) -> Result<(), FormatError>

impl<S: Writer> Hash<S> for char

fn hash<S: Writer>(&self, state: &mut S)