Struct wtf8::CodePoint [] [src]

pub struct CodePoint { /* fields omitted */ }

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

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

Methods

impl CodePoint
[src]

Unsafely create a new CodePoint without checking the value.

Only use when value is known to be less than or equal to 0x10FFFF.

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

Return None if value is above 0x10FFFF.

Create a new CodePoint from a char.

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

Return the numeric value of the code point.

Optionally return a Unicode scalar value for the code point.

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

Return a Unicode scalar value for the code point.

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

Trait Implementations

impl Eq for CodePoint
[src]

impl PartialEq for CodePoint
[src]

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

This method tests for !=.

impl Ord for CodePoint
[src]

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

impl PartialOrd for CodePoint
[src]

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

impl Clone for CodePoint
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for CodePoint
[src]

impl Debug for CodePoint
[src]

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

Formats the value using the given formatter.

impl Hash for CodePoint
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more