Struct quoted_string::spec::PartialCodePoint[][src]

pub struct PartialCodePoint(_);

A type which represents part of a utf-8 code point

It does not know which part of a code point it represents (e.g. utf-8 first or later byte of a code point > 0x7f).

When used in a iteration like context it is also not guaranteed to go through all utf-8 bytes, it might, or it might just represent the first byte replacing all bytes > 0x7f with 0xFF.

This allows efficiently abstracting over char sequences and utf-8 byte sequences for tasks which are mainly focused on us-ascii and treat all non ascii utf8 code points the same.

Methods

impl PartialCodePoint
[src]

creates a partial code point from a utf8 byte

The inner value will be the byte passed in, which should not be 0xff as 0xff doesn't appear in a utf-8 byte sequence

Debug Assertions

if debug assertions are enabled and 0xff is passed in this will panic as it wasn't created from a byte from a utf-8 byte sequence

creates a PartialCodePoint from a utf-8 code point.

The inner value will be:

  • the char if the code point is us-ascii
  • 0xFF if it is larger then 0x7f i.e. non us-ascii

Trait Implementations

impl Copy for PartialCodePoint
[src]

impl Clone for PartialCodePoint
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Ord for PartialCodePoint
[src]

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

impl PartialOrd for PartialCodePoint
[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 Eq for PartialCodePoint
[src]

impl PartialEq for PartialCodePoint
[src]

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

This method tests for !=.

impl Hash for PartialCodePoint
[src]

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

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

impl Debug for PartialCodePoint
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations