Module codepoint

Source
Description

Codepoint operations — Unicode scalar-value methods on :impl Codepoint.

Covers classification, case conversion, integer and string round-trips, UTF-8 / UTF-16 length queries, and Rust-style escape renderings.

Data Types

Unions

CodepointTryFromError

Error produced by (Codepoint .try-from) when an integer does not

ParseCodepointError

Error produced when parsing a Codepoint from a Str.

Aliases

Ascii

7-bit ASCII subset of Codepoint.

Trait Implementations

impl Codepoint

.escape-debug ( Codepoint Str )

Rust-style debug escape (leaves printable Unicode unescaped).

.escape-default ( Codepoint Str )

Rust-style escape rendering suitable for string literals.

.escape-unicode ( Codepoint Str )

\u{XXXX} uppercase hex escape form.

.is-alpha ( Codepoint Bool )

True iff the codepoint is Unicode-alphabetic.

.is-alphanumeric ( Codepoint Bool )

True iff the codepoint is alphabetic or a digit.

.is-ascii ( Codepoint Bool )

True iff the codepoint is in the 0..128 ASCII range.

.is-ascii-alpha ( Codepoint Bool )

True iff the codepoint is 'A' .. 'Z' or 'a' .. 'z'.

.is-ascii-digit ( Codepoint Bool )

True iff the codepoint is '0' .. '9'.

.is-control ( Codepoint Bool )

True iff the codepoint is a Unicode control character (Cc).

.is-digit ( Codepoint Bool )

True iff the codepoint is a Unicode decimal digit (Nd).

.is-lower ( Codepoint Bool )

True iff the codepoint is a lowercase letter.

.is-numeric ( Codepoint Bool )

True iff the codepoint has Numeric_Type != None (broader than Nd).

.is-upper ( Codepoint Bool )

True iff the codepoint is an uppercase letter.

.is-whitespace ( Codepoint Bool )

True iff the codepoint is whitespace.

.len-utf16 ( Codepoint (Int ..) )

Number of UTF-16 code units to encode the codepoint (1 or 2).

.len-utf8 ( Codepoint (Int ..) )

Number of bytes to encode the codepoint in UTF-8 (1, 2, 3, or 4).

.to-digit ( (Int ..) Codepoint (Option (Int ..)) )

Digit value in the given radix (2..=36), or None.

.to-int ( Codepoint (Int ..) )

Integer codepoint value (0 .. 0x10FFFF).

.to-lower ( Codepoint Codepoint )

Unicode lowercase equivalent (first codepoint of the mapping).

.to-str ( Codepoint Str )

Single-codepoint Str.

.to-upper ( Codepoint Codepoint )

Unicode uppercase equivalent (first codepoint of the mapping).