Expand description
This crate provides char, str and string wrappers which have an “is-ascii” soft constraint.
As it is a soft constraint it can be violated, while a violation is (normally) a bug it does not introduce any safety issues. In this soft-ascii-string differs to e.g. ascii which uses a hard constraint and where a violation does brake rust safety and potentially introduces undefined behavior.
Soft-ascii-string is suited for situations where many places (e.g. external libraries) output strings which should be ascii and which you do not want to iterate over to assure they are ascii but where you neither want to use a unsafe conversions as it would be required by the ascii crate.
This crate is not necessarily suited if you want to rally on the string being ascii on a safety level, you might want to consider using ascii in that case.
Modules§
Structs§
- Soft
Ascii Char - a
charwrapper with a “is us-ascii” soft constraint - Soft
Ascii Char Indices - a wrapper around
CharsIndicesturning each char into aSoftAsciiChar - Soft
Ascii Chars - a wrapper around
Charsturning each char into aSoftAsciiChar - Soft
Ascii Lines - a wrapper around
Linesturning each line into aSoftAsciiStr - Soft
Ascii Split Whitespace - a wrapper around
SplitWhitespaceturning each section into aSoftAsciiStr - Soft
Ascii Str - A
strwrapper adding a “is us-ascii” soft constraint. - Soft
Ascii String - a
Stringwrapper with an additional “is us-ascii” soft constraint