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]
impl PartialCodePointpub fn as_u8(self) -> u8[src]
pub fn as_u8(self) -> u8pub fn from_utf8_byte(u8b: u8) -> PartialCodePoint[src]
pub fn from_utf8_byte(u8b: u8) -> PartialCodePointcreates 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
pub fn from_code_point(code_point: u32) -> PartialCodePoint[src]
pub fn from_code_point(code_point: u32) -> PartialCodePointcreates 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 Copy for PartialCodePointimpl Clone for PartialCodePoint[src]
impl Clone for PartialCodePointfn clone(&self) -> PartialCodePoint[src]
fn clone(&self) -> PartialCodePointReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Ord for PartialCodePoint[src]
impl Ord for PartialCodePointfn cmp(&self, other: &PartialCodePoint) -> Ordering[src]
fn cmp(&self, other: &PartialCodePoint) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl PartialOrd for PartialCodePoint[src]
impl PartialOrd for PartialCodePointfn partial_cmp(&self, other: &PartialCodePoint) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &PartialCodePoint) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &PartialCodePoint) -> bool[src]
fn lt(&self, other: &PartialCodePoint) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &PartialCodePoint) -> bool[src]
fn le(&self, other: &PartialCodePoint) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &PartialCodePoint) -> bool[src]
fn gt(&self, other: &PartialCodePoint) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &PartialCodePoint) -> bool[src]
fn ge(&self, other: &PartialCodePoint) -> boolThis 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 Eq for PartialCodePointimpl PartialEq for PartialCodePoint[src]
impl PartialEq for PartialCodePointfn eq(&self, other: &PartialCodePoint) -> bool[src]
fn eq(&self, other: &PartialCodePoint) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &PartialCodePoint) -> bool[src]
fn ne(&self, other: &PartialCodePoint) -> boolThis method tests for !=.
impl Hash for PartialCodePoint[src]
impl Hash for PartialCodePointfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for PartialCodePoint[src]
impl Debug for PartialCodePointAuto Trait Implementations
impl Send for PartialCodePoint
impl Send for PartialCodePointimpl Sync for PartialCodePoint
impl Sync for PartialCodePoint