Module char
Utilities for the char primitive type.
See also the char primitive type.
The char type represents a single character. More specifically, since
'character' isn't a well-defined concept in Unicode, char is a 'Unicode
scalar value', which is similar to, but not the same as, a 'Unicode code
point'.
This module exists for technical reasons, the primary documentation for
char is directly on [the char primitive type][char] itself.
This module is the home of the iterator implementations for the iterators
implemented on char, as well as some useful constants and conversion
functions that convert various types to char.
Modules
Structs
- CaseMappingIter
-
CharTryFromError
The error type returned when a conversion from [
prim@u32] to [prim@char] fails. -
DecodeUtf16
An iterator that decodes UTF-16 encoded code points from an iterator of
u16s. - DecodeUtf16Error An error that can be returned when decoding UTF-16 code points.
-
EscapeDebug
An iterator that yields the literal escape code of a
char. -
EscapeDefault
An iterator that yields the literal escape code of a
char. -
EscapeUnicode
Returns an iterator that yields the hexadecimal Unicode escape of a
character, as
chars. - ParseCharError An error which can be returned when parsing a char.
-
ToCasefold
Returns an iterator that yields the case-folded equivalent of a
char. -
ToLowercase
Returns an iterator that yields the lowercase equivalent of a
char. -
ToTitlecase
Returns an iterator that yields the titlecase equivalent of a
char. -
ToUppercase
Returns an iterator that yields the uppercase equivalent of a
char. - TryFromCharError The error type returned when a checked char conversion fails.
Enums
-
CharCase
The case of a cased character,
as returned by
char::case.
Functions
-
decode_utf16
Creates an iterator over the UTF-16 encoded code points in
iter, returning unpaired surrogates asErrs. Usechar::decode_utf16instead. -
encode_utf16_raw
Encodes a raw
u32value as native endian UTF-16 into the providedu16buffer, and then returns the subslice of the buffer that contains the encoded character. -
encode_utf8_raw
Encodes a raw
u32value as UTF-8 into the provided byte buffer, and then returns the subslice of the buffer that contains the encoded character. -
encode_utf8_raw_unchecked
Encodes a raw
u32value as UTF-8 into the byte buffer pointed to bydst. -
from_digit
Converts a digit in the given radix to a
char. Usechar::from_digitinstead. -
from_u32
Converts a
u32to achar. Usechar::from_u32instead. -
from_u32_unchecked
Converts a
u32to achar, ignoring validity. Usechar::from_u32_uncheckedinstead.
Constants
-
MAX
The highest valid code point a
charcan have,'\u{10FFFF}'. Usechar::MAXinstead. - MAX_ONE_B
- MAX_THREE_B
- MAX_TWO_B
-
REPLACEMENT_CHARACTER
U+FFFD REPLACEMENT CHARACTER(�) is used in Unicode to represent a decoding error. Usechar::REPLACEMENT_CHARACTERinstead. - TAG_CONT
- TAG_FOUR_B
- TAG_THREE_B
- TAG_TWO_B
-
UNICODE_VERSION
The version of Unicode that the Unicode parts of
charandstrmethods are based on. Usechar::UNICODE_VERSIONinstead.