Operations on ASCII strings and characters.
Ascii
- Datatype to hold one ascii characterAsciiCast
- Trait for converting into an ascii type.AsciiStr
- Trait for converting an ascii type to a stringOwnedAsciiCast
- Trait for copyless casting to an ascii vector.ToBytesConsume
- Trait to convert to a owned byte array by consuming selfof ::std::clone::Clone for Ascii
- Automatically derived.of ::std::cmp::Eq for Ascii
- Automatically derived.for Ascii
of ToStr for Ascii
of AsciiCast<&'self [Ascii]> for &'self [u8] where <'self>
of AsciiCast<&'self [Ascii]> for &'self str where <'self>
of AsciiCast<Ascii> for u8
of AsciiCast<Ascii> for char
of OwnedAsciiCast for ~[u8]
of OwnedAsciiCast for ~str
of AsciiStr for &'self [Ascii] where <'self>
of ToStrConsume for ~[Ascii]
of IterBytes for Ascii
of ToBytesConsume for ~[Ascii]
Ascii
pub struct Ascii {
priv chr: u8,
}
Datatype to hold one ascii character. It wraps a u8
, with the highest bit always zero.
AsciiCast
Trait for converting into an ascii type.
to_ascii
fn to_ascii(&self) -> T
Convert to an ascii type
to_ascii_nocheck
unsafe fn to_ascii_nocheck(&self) -> T
Convert to an ascii type, not doing any range asserts
is_ascii
fn is_ascii(&self) -> bool
Check if convertible to ascii
AsciiStr
Trait for converting an ascii type to a string. Needed to convert &[Ascii]
to ~str
to_str_ascii
fn to_str_ascii(&self) -> ~str
Convert to a string.
to_lower
fn to_lower(&self) -> ~[Ascii]
Convert to vector representing a lower cased ascii string.
to_upper
fn to_upper(&self) -> ~[Ascii]
Convert to vector representing a upper cased ascii string.
eq_ignore_case
fn eq_ignore_case(self, other: &[Ascii]) -> bool
Compares two Ascii strings ignoring case
OwnedAsciiCast
Trait for copyless casting to an ascii vector.
into_ascii
fn into_ascii(self) -> ~[Ascii]
Take ownership and cast to an ascii vector without trailing zero element.
into_ascii_nocheck
unsafe fn into_ascii_nocheck(self) -> ~[Ascii]
Take ownership and cast to an ascii vector without trailing zero element. Does not perform validation checks.
ToBytesConsume
Trait to convert to a owned byte array by consuming self
into_bytes
fn into_bytes(self) -> ~[u8]
Converts to a owned byte array by consuming self
::std::clone::Clone
for Ascii
Automatically derived.
clone
fn clone(&self) -> Ascii
::std::cmp::Eq
for Ascii
Automatically derived.
eq
fn eq(&self, __arg_0: &Ascii) -> ::bool
ne
fn ne(&self, __arg_0: &Ascii) -> ::bool
Ascii
to_byte
fn to_byte(self) -> u8
Converts a ascii character into a u8
.
to_char
fn to_char(self) -> char
Converts a ascii character into a char
.
to_lower
fn to_lower(self) -> Ascii
Convert to lowercase.
to_upper
fn to_upper(self) -> Ascii
Convert to uppercase.
eq_ignore_case
fn eq_ignore_case(self, other: Ascii) -> bool
Compares two ascii characters of equality, ignoring case.
ToStr
for Ascii
to_str
fn to_str(&self) -> ~str
AsciiCast<&'self [Ascii]>
for &'self [u8]
where <'self>
to_ascii
fn to_ascii(&self) -> &'self [Ascii]
to_ascii_nocheck
unsafe fn to_ascii_nocheck(&self) -> &'self [Ascii]
is_ascii
fn is_ascii(&self) -> bool
AsciiCast<&'self [Ascii]>
for &'self str
where <'self>
to_ascii
fn to_ascii(&self) -> &'self [Ascii]
to_ascii_nocheck
unsafe fn to_ascii_nocheck(&self) -> &'self [Ascii]
is_ascii
fn is_ascii(&self) -> bool
AsciiCast<Ascii>
for u8
to_ascii
fn to_ascii(&self) -> Ascii
to_ascii_nocheck
unsafe fn to_ascii_nocheck(&self) -> Ascii
is_ascii
fn is_ascii(&self) -> bool
AsciiCast<Ascii>
for char
to_ascii
fn to_ascii(&self) -> Ascii
to_ascii_nocheck
unsafe fn to_ascii_nocheck(&self) -> Ascii
is_ascii
fn is_ascii(&self) -> bool
OwnedAsciiCast
for ~[u8]
into_ascii
fn into_ascii(self) -> ~[Ascii]
into_ascii_nocheck
unsafe fn into_ascii_nocheck(self) -> ~[Ascii]
OwnedAsciiCast
for ~str
into_ascii
fn into_ascii(self) -> ~[Ascii]
into_ascii_nocheck
unsafe fn into_ascii_nocheck(self) -> ~[Ascii]
AsciiStr
for &'self [Ascii]
where <'self>
to_str_ascii
fn to_str_ascii(&self) -> ~str
to_lower
fn to_lower(&self) -> ~[Ascii]
to_upper
fn to_upper(&self) -> ~[Ascii]
eq_ignore_case
fn eq_ignore_case(self, other: &[Ascii]) -> bool
ToStrConsume
for ~[Ascii]
into_str
fn into_str(self) -> ~str
IterBytes
for Ascii
iter_bytes
fn iter_bytes(&self, _lsb0: bool, f: &fn(buf: &[u8]) -> bool) -> bool
ToBytesConsume
for ~[Ascii]
into_bytes
fn into_bytes(self) -> ~[u8]