21 releases (1 stable)

Uses old Rust 2015

1.0.0 Aug 26, 2019
0.9.3 Aug 26, 2019
0.9.2 Jul 7, 2019
0.9.1 Sep 12, 2018
0.0.1 Nov 27, 2014

#235 in Text processing

Download history 43044/week @ 2021-10-04 46202/week @ 2021-10-11 46455/week @ 2021-10-18 40529/week @ 2021-10-25 41511/week @ 2021-11-01 41240/week @ 2021-11-08 42694/week @ 2021-11-15 37799/week @ 2021-11-22 49591/week @ 2021-11-29 51695/week @ 2021-12-06 51736/week @ 2021-12-13 38315/week @ 2021-12-20 27894/week @ 2021-12-27 47138/week @ 2022-01-03 53042/week @ 2022-01-10 53060/week @ 2022-01-17

183,702 downloads per month
Used in 529 crates (37 directly)

Apache-2.0 / MIT

2.5K SLoC


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

Types and conversion traits are described in the Documentation.

You can include this crate in your cargo project by adding it to the dependencies section in Cargo.toml:

ascii = "1.0"

Using ascii without libstd

Most of AsciiChar and AsciiStr can be used without std by disabling the default features. The owned string type AsciiString and the conversion trait IntoAsciiString as well as all methods referring to these types and CStr and CString are unavailable. The Error trait is also unavailable, but description() is made available as an inherent method for ToAsciiCharError and AsAsciiStrError.

To use the ascii crate in core-only mode in your cargo project just add the following dependency declaration in Cargo.toml:

ascii = { version = "1.0", default-features = false }

Minimum supported Rust version

The minimum Rust version for 1.0.* releases is 1.33.0. 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.38 when ascii 1.1.0 is released, then ascii 1.1.* will not require a newer Rust version than 1.36.


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.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.