Expand description
A library that provides ASCII-only string and character types, equivalent to the char
, str
and String
types in the standard library.
Please refer to the readme file to learn about the different feature modes of this crate.
§Minimum supported Rust version
The minimum Rust version for 1.1.* releases is 1.41.1.
Later 1.y.0 releases might require newer Rust versions, but the three most
recent stable releases at the time of publishing will always be supported.
For example this means that if the current stable Rust version is 1.70 when
ascii 1.2.0 is released, then ascii 1.2.* will not require a newer
Rust version than 1.68.
§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§
- AsAscii
StrError - Error that is returned when a sequence of
u8
are not all ASCII. - Ascii
Str AsciiStr
represents a byte or string slice that only contains ASCII characters.- Ascii
String - A growable string stored as an ASCII encoded buffer.
- Chars
- A copying iterator over the characters of an
AsciiStr
. - Chars
Mut - A mutable iterator over the characters of an
AsciiStr
. - Chars
Ref - An immutable iterator over the characters of an
AsciiStr
. - From
Ascii Error - A possible error value when converting an
AsciiString
from a byte vector or string. It wraps anAsAsciiStrError
which you can get through theascii_error()
method. - ToAscii
Char Error - Error returned by
ToAsciiChar
.
Enums§
- Ascii
Char - An ASCII character. It wraps a
u8
, with the highest bit always zero.
Traits§
- AsAscii
Str - Convert slices of bytes or
AsciiChar
toAsciiStr
. - AsMut
Ascii Str - Convert mutable slices of bytes or
AsciiChar
toAsciiStr
. - Into
Ascii String - Convert vectors into
AsciiString
. - ToAscii
Char - Convert
char
,u8
and other character types toAsciiChar
.
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.