[][src]Crate ascii

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

The documentation for the core mode is here. Please refer to the readme file to learn about the different feature modes of this crate.

Requirements

History

This package 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.

FromAsciiError

A possible error value when converting an AsciiString from a byte vector or string. It wraps an AsAsciiStrError which you can get through the ascii_error() method.

Lines

An iterator over the lines of the internal character array.

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.

Functions

caret_decode

Returns the control code represented by a caret notation letter, or None if the letter is not used in caret notation.

caret_encode

Terminals use caret notation to display some typed control codes, such as ^D for EOT and ^Z for SUB.

Type Definitions

Chars

An immutable iterator over the characters of an AsciiStr.

CharsMut

A mutable iterator over the characters of an AsciiStr.