Macros§
- Creates a
CompactStringusing interpolation of runtime expressions.
Structs§
- A
CompactStringis a compact string type that can be used almost anywhere aStringorstrcan be used.
Constants§
Traits§
- A trait that provides convenience methods for creating a
CompactStringfrom a collection of items. It is implemented for all types that can be converted into an iterator, and that iterator yields types that can be converted into astr. - A trait for converting a value to a
CompactString. - Implemented indexing trait for String and str which uses the UnicodeSegmentation facilities to enable grapheme iteration by default. There could be some performance penalty, but it will allow for native Unicode support to the best extent possible.
Functions§
- Turn UTF-8 character into escaped character sequence
- This function will scan through an unescaped string and escape any characters outside the ASCII printable range.
- Implements decoding this string from its auto-detected encoding to UTF-8. Failing that we assume the string was encoded in UTF-8 and return a copy.
- Implements decoding this string from a specific encoding to UTF-8.
- Turn escaped character sequence into the equivalent UTF-8 character This function accepts \o, \x and \u formats. This function will also attempt to unescape the common C style control characters. Anything else needs to be expressed as hex or octal patterns with the formats above.
- This function will scan through an escaped string and unescape any escaped characters. We collect these characters as a byte vector. Finally, we do a decode pass on the vector to re-encode the bytes hopefully right into a valid UTF-8 string.