Module rustc_unicode::char [] [src]

A Unicode scalar value

This module provides the CharExt`CharExttrait, as well as its implementation for the primitivechar` type, in order to allow basic character manipulation.

A char`char` represents a Unicode scalar value, as it can contain any Unicode code point except high-surrogate and low-surrogate code points.

As such, only values in the ranges [0x0,0xD7FF] and [0xE000,0x10FFFF] (inclusive) are allowed. A char`charcan always be safely cast to au32; however the converse is not always true due to the above range limits and, as such, should be performed via thefrom_u32` function.

See also the char`char` primitive type.

Structs

EscapeDefault

An iterator over the characters that represent a char`char`, escaped for maximum portability.

EscapeUnicode

An iterator over the characters that represent a char`char`, as escaped by Rust's unicode escaping rules.

ToLowercase

An iterator over the lowercase mapping of a given character, returned from the to_lowercase method on characters.

ToUppercase

An iterator over the uppercase mapping of a given character, returned from the to_uppercase method on characters.

Constants

MAX

The highest valid code point

UNICODE_VERSION [Unstable]

The version of Unicode that the unicode parts of CharExt`CharExtand` and UnicodeStrPrelude traits are based on.

Functions

from_digit

Converts a number to the character representing it.

from_u32

Converts a u32`u32to an` to an Option<char>.

canonical_combining_class [Deprecated]
compose [Deprecated]
decompose_canonical [Deprecated]

Compute canonical Unicode decomposition for character

decompose_compatible [Deprecated]

Compute canonical or compatible Unicode decomposition for character

from_u32_unchecked [Unstable]

Converts a u32`u32to an` to an char`char`, not checking whether it is a valid unicode codepoint.

Implementations