Skip to main content

Module strings

Module strings 

Source

Macros§

rumtk_format
Creates a CompactString using interpolation of runtime expressions.

Structs§

CompactString
A CompactString is a compact string type that can be used almost anywhere a String or str can be used.
GraphemeStr
The equivalent to a stringview but at the grapheme level. Meaning, we can use this view to iterate through a string at the full UTF8 implementation

Constants§

DOT_STR
EMPTY_STRING
EMPTY_STRING_OPTION
READABLE_ASCII

Traits§

AsStr
CompactStringExt
A trait that provides convenience methods for creating a CompactString from 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 a str.
RUMArrayConversions
RUMStringConversions
StringLike
StringUtils
ToCompactString
A trait for converting a value to a CompactString.

Functions§

basic_escape
Escape UTF-8 characters in UTF-8 string that are beyond ascii range
count_tokens_ignoring_pattern
escape
Turn UTF-8 character into escaped character sequence as expected in HL7
filter_ascii
Removes all non ASCII and all non printable characters from string.
filter_non_printable_ascii
Removes all non ASCII and all non printable characters from string.
get_grapheme_collection
Return vector of graphemes from starting spot up until we find the end grapheme.
get_grapheme_string
Get the grapheme block and concatenate it into a newly allocated RUMString.
is_ascii_str
Checks if a given string is fully ASCII or within the ASCII range.
is_escaped_str
Checks if an input string is already escaped. The idea is to avoid escaping the escaped string thus making it a nightmare to undo the escaping later on.
is_printable_char
Returns whether a character is in the ASCII printable range.
try_decode
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.
try_decode_with
Implements decoding this string from a specific encoding to UTF-8.
unescape
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.
unescape_string
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.

Type Aliases§

EscapeException
EscapeExceptions
Grapheme
GraphemePattern
GraphemePatternPair
GraphemeSlice
GraphemeStringView
RUMString