FastCodePointTrie

Struct FastCodePointTrie 

Source
pub struct FastCodePointTrie<'trie, T: TrieValue> { /* private fields */ }
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.

Trait Implementations§

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: 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§

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 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.

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> 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> 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, 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.