Skip to main content

FastCodePointTrie

Struct FastCodePointTrie 

Source
#[repr(transparent)]
pub struct FastCodePointTrie<'trie, T: TrieValue> { inner: CodePointTrie<'trie, T>, }
Expand description

Type-safe wrapper for a fast trie guaranteeing the the getters don’t branch on the trie type and for guarenteeing that get16 is branchless in release builds.

Fields§

§inner: CodePointTrie<'trie, T>

Trait Implementations§

Source§

impl<'trie, T: TrieValue> AbstractCodePointTrie<'trie, T> for FastCodePointTrie<'trie, T>

Source§

unsafe fn ascii(&self, ascii: u8) -> T

Look up trie value by an ASCII character. Read more
Source§

unsafe fn utf8_two_byte(&self, high_five: u32, low_six: u32) -> T

Look up trie value by a two-byte UTF-8 sequence. Read more
Source§

unsafe fn utf8_three_byte(&self, high_ten: u32, low_six: u32) -> T

Look up trie value by a three-byte UTF-8 or WTF-8 sequence. Read more
Source§

fn latin1(&self, latin1: u8) -> T

Look up trie value by a Latin1 character.
Source§

fn bmp(&self, bmp: u16) -> T

Look up trie value by a Basic Multilingual Plane character. Read more
Source§

fn supplementary(&self, supplementary: u32) -> T

Look up trie value by a non-Basic Multilingual Plane character. Read more
Source§

fn scalar(&self, scalar: char) -> T

Look up trie value by a Unicode Scalar Value.
Source§

fn code_point(&self, code_point: u32) -> T

Look up trie value by Unicode Code Point. Read more
Source§

impl<'trie, T: Clone + TrieValue> Clone for FastCodePointTrie<'trie, T>

Source§

fn clone(&self) -> FastCodePointTrie<'trie, T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'trie, T: Debug + TrieValue> Debug for FastCodePointTrie<'trie, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'trie, T: PartialEq + TrieValue> PartialEq for FastCodePointTrie<'trie, T>

Source§

fn eq(&self, other: &FastCodePointTrie<'trie, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'trie, T: TrieValue> TryFrom<&'trie CodePointTrie<'trie, T>> for &'trie FastCodePointTrie<'trie, T>

Source§

type Error = TypedCodePointTrieError

The type returned in the event of a conversion error.
Source§

fn try_from( reference: &'trie CodePointTrie<'trie, T>, ) -> Result<&'trie FastCodePointTrie<'trie, T>, TypedCodePointTrieError>

Performs the conversion.
Source§

impl<'trie, T: TrieValue> TryFrom<CodePointTrie<'trie, T>> for FastCodePointTrie<'trie, T>

Source§

type Error = TypedCodePointTrieError

The type returned in the event of a conversion error.
Source§

fn try_from( value: CodePointTrie<'trie, T>, ) -> Result<FastCodePointTrie<'trie, T>, TypedCodePointTrieError>

Performs the conversion.
Source§

impl<'trie, T: TrieValue> TypedCodePointTrie<'trie, T> for FastCodePointTrie<'trie, T>

Source§

fn as_untyped_ref(&self) -> &CodePointTrie<'trie, T>

Returns a reference to the wrapped CodePointTrie.

Source§

fn to_untyped(self) -> CodePointTrie<'trie, T>

Extracts the wrapped CodePointTrie.

Source§

fn get16(&self, bmp: u16) -> T

Lookup trie value by Basic Multilingual Plane Code Point without branching on trie type.

Source§

unsafe fn get_utf8_three_byte(&self, high_ten: u32, low_six: u32) -> T

Returns the value that is associated with a three-byte UTF-8 or WTF-8 sequence.

high_ten is the low four bits of the lead byte of three-byte UTF-8 or WTF-8 sequence shifted left by 6 followed by the low six bits of the first trail byte. low_six is the low six bits of the last trail byte of a three-byte UTF-8 or WTF-8 sequence.

Sequences representing surrogates (WTF-8) are allowed.

§Safety

high_ten must not have bit positions other than the lowest 10 set to 1. low_six must not have bit positions other than the lowest 6 set to 1.

§Panics

With debug assertions enabled, panics if the above safety invariants are violated or high_ten is out of range for three-byte WTF-8 (or UTF-8) sequence.

Source§

const TRIE_TYPE: TrieType = TrieType::Fast

The TrieType associated with this TypedCodePointTrie Read more
Source§

fn get32_u32(&self, code_point: u32) -> u32

Lookup trie value as u32 by Unicode Scalar Value without branching on trie type.
Source§

fn get8(&self, latin1: u8) -> T

Lookup trie value by Latin1 Code Point without branching on trie type.
Source§

unsafe fn get7(&self, ascii: u8) -> T

Lookup trie value by ASCII Code Point without branching on trie type. Read more
Source§

fn get32_supplementary(&self, supplementary: u32) -> T

Lookup trie value by non-Basic Multilingual Plane Scalar Value without branching on trie type.
Source§

fn get(&self, c: char) -> T

Lookup trie value by Unicode Scalar Value without branching on trie type.
Source§

fn get32(&self, code_point: u32) -> T

Lookup trie value by Unicode Code Point without branching on trie type.
Source§

fn get32_by_fast_index(&self, code_point: u32) -> Option<T>

Returns the value that is associated with code_point in this CodePointTrie if code_point uses fast-path lookup or None if code_point should use small-path lookup or is above the supported range.
Source§

unsafe fn get_utf8_two_byte(&self, high_five: u32, low_six: u32) -> T

Returns the value that is associated with a two-byte UTF-8 sequence. Read more
Source§

impl<'yoke, T> Yokeable<'yoke> for FastCodePointTrie<'static, T>
where T: 'static + TrieValue,

Source§

type Output = FastCodePointTrie<'yoke, T>

This type MUST be Self with the 'static replaced with 'a, i.e. Self<'a>
Source§

fn transform(&'yoke self) -> &'yoke Self::Output

This method must cast self between &'a Self<'static> and &'a Self<'a>. Read more
Source§

fn transform_owned(self) -> Self::Output

This method must cast self between Self<'static> and Self<'a>. Read more
Source§

unsafe fn make(from: Self::Output) -> Self

This method can be used to cast away Self<'a>’s lifetime. Read more
Source§

fn transform_mut<F>(&'yoke mut self, f: F)
where F: 'static + for<'_yoke> FnOnce(&'_yoke mut Self::Output),

This method must cast self between &'a mut Self<'static> and &'a mut Self<'a>, and pass it to f. Read more
Source§

impl<'zf, 'zf_inner, T: TrieValue> ZeroFrom<'zf, FastCodePointTrie<'zf_inner, T>> for FastCodePointTrie<'zf, T>
where CodePointTrie<'zf, T>: ZeroFrom<'zf, CodePointTrie<'zf_inner, T>>,

Source§

fn zero_from(this: &'zf FastCodePointTrie<'zf_inner, T>) -> Self

Clone the other C into a struct that may retain references into C.
Source§

impl<'trie, T: Eq + TrieValue> Eq for FastCodePointTrie<'trie, T>

Source§

impl<'trie, T: TrieValue> Seal for FastCodePointTrie<'trie, T>

Source§

impl<'trie, T: TrieValue> StructuralPartialEq for FastCodePointTrie<'trie, T>

Auto Trait Implementations§

§

impl<'trie, T> Freeze for FastCodePointTrie<'trie, T>
where T: Freeze,

§

impl<'trie, T> RefUnwindSafe for FastCodePointTrie<'trie, T>
where T: RefUnwindSafe, <T as AsULE>::ULE: RefUnwindSafe,

§

impl<'trie, T> Send for FastCodePointTrie<'trie, T>
where T: Send, <T as AsULE>::ULE: Send + Sync,

§

impl<'trie, T> Sync for FastCodePointTrie<'trie, T>
where T: Sync, <T as AsULE>::ULE: Sync,

§

impl<'trie, T> Unpin for FastCodePointTrie<'trie, T>
where T: Unpin, <T as AsULE>::ULE: Unpin,

§

impl<'trie, T> UnsafeUnpin for FastCodePointTrie<'trie, T>
where T: UnsafeUnpin,

§

impl<'trie, T> UnwindSafe for FastCodePointTrie<'trie, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,