Struct wtf8_rs::codepoint::CodePoint[][src]

pub struct CodePoint { /* fields omitted */ }
Expand description

A Unicode code point: from U+0000 to U+10FFFF.

Compares with the char type, which represents a Unicode scalar value: a code point that is not a surrogate (U+D800 to U+DFFF).

Implementations

Unsafely creates a new CodePoint without checking the value.

Safety

Only safe if value is less than or equal to 0x10FFFF.

Creates a new CodePoint if the value is a valid code point.

Returns None if value is above 0x10FFFF.

Creates a new CodePoint from a char.

Since all Unicode scalar values are code points, this always succeeds.

Returns the numeric value of the code point.

Optionally returns a Unicode scalar value for the code point.

Returns None if the code point is a surrogate (from U+D800 to U+DFFF).

Returns a Unicode scalar value for the code point.

Returns '\u{FFFD}' (the replacement character “�”) if the code point is a surrogate (from U+D800 to U+DFFF).

Decode potentially ill-formed UTF-16.

Encode potentially ill-formed UTF-16.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Format the code point as U+ followed by four to six hexadecimal digits. Example: U+1F4A9

Formats the value using the given formatter. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Append code points from an iterator to the string.

This replaces surrogate code point pairs with supplementary code points, like concatenating ill-formed UTF-16 strings effectively would.

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Performs the conversion.

Creates a value from an iterator. Read more

Creates a new WTF-8 string from an iterator of code points.

This replaces surrogate code point pairs with supplementary code points, like concatenating ill-formed UTF-16 strings effectively would.

Creates a value from an iterator. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.