[src]

Struct std::ascii::Ascii

pub struct Ascii {
    // some fields omitted
}

Datatype to hold one ascii character. It wraps a u8, with the highest bit always zero.

Methods

impl Ascii

fn to_byte(self) -> u8

Converts an ascii character into a u8.

fn to_char(self) -> char

Converts an ascii character into a char.

fn to_lower(self) -> Ascii

Convert to lowercase.

fn to_upper(self) -> Ascii

Convert to uppercase.

fn eq_ignore_case(self, other: Ascii) -> bool

Compares two ascii characters of equality, ignoring case.

fn is_alpha(&self) -> bool

Check if the character is a letter (a-z, A-Z)

fn is_digit(&self) -> bool

Check if the character is a number (0-9)

fn is_alnum(&self) -> bool

Check if the character is a letter or number

fn is_blank(&self) -> bool

Check if the character is a space or horizontal tab

fn is_control(&self) -> bool

Check if the character is a control character

fn is_graph(&self) -> bool

Checks if the character is printable (except space)

fn is_print(&self) -> bool

Checks if the character is printable (including space)

fn is_lower(&self) -> bool

Checks if the character is lowercase

fn is_upper(&self) -> bool

Checks if the character is uppercase

fn is_punctuation(&self) -> bool

Checks if the character is punctuation

fn is_hex(&self) -> bool

Checks if the character is a valid hex digit

Trait Implementations

impl<'a> Show for Ascii

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

Formats the value using the given formatter.

Derived Implementations

impl<__S: Writer> Hash<__S> for Ascii

fn hash(&self, __arg_0: &mut __S)

Compute a hash of the value.

impl TotalEq for Ascii

fn assert_receiver_is_total_eq(&self)

impl TotalOrd for Ascii

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

impl Ord for Ascii

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

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

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

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

impl Eq for Ascii

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

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

impl Clone for Ascii

fn clone(&self) -> Ascii

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.