[−][src]Struct quoted_string::spec::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]
pub fn as_u8(self) -> u8
[src]
pub fn from_utf8_byte(u8b: u8) -> 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
pub fn from_code_point(code_point: u32) -> PartialCodePoint
[src]
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 Clone for PartialCodePoint
[src]
fn clone(&self) -> PartialCodePoint
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PartialCodePoint
[src]
impl Eq for PartialCodePoint
[src]
impl Ord for PartialCodePoint
[src]
fn cmp(&self, other: &PartialCodePoint) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<PartialCodePoint> for PartialCodePoint
[src]
fn eq(&self, other: &PartialCodePoint) -> bool
[src]
fn ne(&self, other: &PartialCodePoint) -> bool
[src]
impl PartialOrd<PartialCodePoint> for PartialCodePoint
[src]
fn partial_cmp(&self, other: &PartialCodePoint) -> Option<Ordering>
[src]
fn lt(&self, other: &PartialCodePoint) -> bool
[src]
fn le(&self, other: &PartialCodePoint) -> bool
[src]
fn gt(&self, other: &PartialCodePoint) -> bool
[src]
fn ge(&self, other: &PartialCodePoint) -> bool
[src]
impl Debug for PartialCodePoint
[src]
impl Hash for PartialCodePoint
[src]
Auto Trait Implementations
impl Send for PartialCodePoint
impl Sync for PartialCodePoint
impl Unpin for PartialCodePoint
impl UnwindSafe for PartialCodePoint
impl RefUnwindSafe for PartialCodePoint
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,