soft_ascii_string/lib.rs
1//! This crate provides char, str and string wrappers which
2//! have an "is-ascii" soft constraint.
3//!
4//! As it is a soft constraint it can be violated, while a violation
5//! is (normally) a bug it _does not_ introduce any safety issues.
6//! In this soft-ascii-string differs to e.g. [ascii](https://crates.io/crates/ascii)
7//! which uses a hard constraint and where a violation does brake
8//! rust safety and potentially introduces undefined behavior.
9//!
10//! Soft-ascii-string is suited for situations where many places
11//! (e.g. external libraries) output strings which should be
12//! ascii and which you do not want to iterate over to assure
13//! they are ascii but where you neither want to use a unsafe
14//! conversions as it would be required by the ascii crate.
15//!
16//! This crate is not necessarily suited if you want to rally on the string
17//! being ascii on a safety level, you might want to consider using
18//! [ascii](https://crates.io/crates/ascii) in that case.
19
20
21pub use self::soft_char::*;
22pub use self::soft_str::*;
23pub use self::soft_string::*;
24
25#[macro_use]
26mod macros;
27
28pub mod error;
29mod soft_char;
30// note while they are separated for readability str/string
31// still do form one unit, i.e. there is a cyclic reference
32// between SoftAsciiString<->SoftAsciiStr and others
33mod soft_str;
34mod soft_string;
35
36
37// - IndexMut (returns a &mut SoftAsciiStr)
38// - DerefMut (returns a &mut SoftAsciiStr)
39// - fuzzed test for forwarded method