[][src]Crate soft_ascii_string

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.





a char wrapper with a "is us-ascii" soft constraint


a wrapper around CharsIndices turning each char into a SoftAsciiChar


a wrapper around Chars turning each char into a SoftAsciiChar


a wrapper around Lines turning each line into a SoftAsciiStr


a wrapper around SplitWhitespace turning each section into a SoftAsciiStr


A str wrapper adding a "is us-ascii" soft constraint.


a String wrapper with an additional "is us-ascii" soft constraint