Crate ascii [] [src]

A library that provides ASCII-only string and character types, equivalent to the char, str and String types in the standard library.

Using ascii without libstd

Most of AsciiChar and AsciiStr can be used without std by enabling the feature no_std. The owned string type AsciiString and the conversion trait IntoAsciiString as well as all methods referring to these types aren't available without std.

Requirements

The ascii library requires rustc 1.9.0 or greater, due to the stabilization of AsciiExt. Using the no_std feature lowers this requirement to rustc 1.6.0 or greater.

History

This packages included the Ascii types that were removed from the Rust standard library by the 2014-12 reform of the std::ascii module. The API changed significantly since then.

Structs

AsAsciiStrError

Error that is returned when a sequence of u8 are not all ASCII.

AsciiStr

AsciiStr represents a byte or string slice that only contains ASCII characters.

AsciiString

A growable string stored as an ASCII encoded buffer.

ToAsciiCharError

Error returned by ToAsciiChar.

Enums

AsciiChar

An ASCII character. It wraps a u8, with the highest bit always zero.

Traits

AsAsciiStr

Convert slices of bytes to AsciiStr.

AsMutAsciiStr

Convert mutable slices of bytes to AsciiStr.

IntoAsciiString

Convert vectors into AsciiString.

ToAsciiChar

Convert char, u8 and other character types to AsciiChar.