Struct std::ascii::Ascii

pub struct Ascii {
    priv chr: u8,
}

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 a ascii character into a u8.

fn to_char(self) -> char

Converts a 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.

Trait Implementations

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.

impl Eq for Ascii

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

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

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 TotalOrd for Ascii

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

impl TotalEq for Ascii

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

impl ToStr for Ascii

fn to_str(&self) -> ~str

Converts the value of self to an owned string

impl IterBytes for Ascii

fn iter_bytes(&self, _lsb0: bool, f: &fn(buf: &[u8]) -> bool) -> bool

Call the provided callback f one or more times with byte-slices that should be used when computing a hash value or otherwise "flattening" the structure into a sequence of bytes. The lsb0 parameter conveys whether the caller is asking for little-endian bytes (true) or big-endian (false); this should only be relevant in implementations that represent a single multi-byte datum such as a 32 bit integer or 64 bit floating-point value. It can be safely ignored for larger structured types as they are usually processed left-to-right in declaration order, regardless of underlying memory endianness.