Skip to main content

Module str

Module str 

Source

Re-exports§

pub use ascii;

Modules§

levenshtein

Macros§

ascii
Creates an AsciiStr from a string literal, throwing a compile error if the literal isn’t actually ascii.

Structs§

StrData
UnicodeEscapeCodepoint

Enums§

PyKindStr
StrKind
Utf8 + state.ascii (+ PyUnicode_Kind in future)

Traits§

DeduceStrKind

Functions§

char_range_end
char_to_decimal
The decimal digit value of ch, if it has one — CPython’s Py_UNICODE_TODECIMAL.
codepoint_range_end
expandtabs
Replace all tabs in a string with spaces, using the given tab size.
get_chars
get_codepoints
to_ascii
Convert a string to ascii compatible, escaping unicode-s into escape sequences.
transform_decimal_and_space_to_ascii
Replace Unicode decimal digits with their ASCII equivalents and any Unicode whitespace with a plain space, so the byte-oriented numeric parsers can read them. Mirrors CPython’s _PyUnicode_TransformDecimalAndSpaceToASCII.
try_get_chars
try_get_codepoints
zfill
Returns None for a width whose result cannot be allocated.

Type Aliases§

wchar_t