#[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>
impl<'trie, T: TrieValue> AbstractCodePointTrie<'trie, T> for FastCodePointTrie<'trie, T>
Source§unsafe fn utf8_two_byte(&self, high_five: u32, low_six: u32) -> T
unsafe fn utf8_two_byte(&self, high_five: u32, low_six: u32) -> T
Source§unsafe fn utf8_three_byte(&self, high_ten: u32, low_six: u32) -> T
unsafe fn utf8_three_byte(&self, high_ten: u32, low_six: u32) -> T
Source§fn bmp(&self, bmp: u16) -> T
fn bmp(&self, bmp: u16) -> T
Source§fn supplementary(&self, supplementary: u32) -> T
fn supplementary(&self, supplementary: u32) -> T
Source§fn code_point(&self, code_point: u32) -> T
fn code_point(&self, code_point: u32) -> T
Source§impl<'trie, T: Clone + TrieValue> Clone for FastCodePointTrie<'trie, T>
impl<'trie, T: Clone + TrieValue> Clone for FastCodePointTrie<'trie, T>
Source§fn clone(&self) -> FastCodePointTrie<'trie, T>
fn clone(&self) -> FastCodePointTrie<'trie, T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'trie, T: PartialEq + TrieValue> PartialEq for FastCodePointTrie<'trie, T>
impl<'trie, T: PartialEq + TrieValue> PartialEq for FastCodePointTrie<'trie, T>
Source§fn eq(&self, other: &FastCodePointTrie<'trie, T>) -> bool
fn eq(&self, other: &FastCodePointTrie<'trie, T>) -> bool
self and other values to be equal, and is used by ==.Source§impl<'trie, T: TrieValue> TryFrom<&'trie CodePointTrie<'trie, T>> for &'trie FastCodePointTrie<'trie, T>
impl<'trie, T: TrieValue> TryFrom<&'trie CodePointTrie<'trie, T>> for &'trie FastCodePointTrie<'trie, T>
Source§type Error = TypedCodePointTrieError
type Error = TypedCodePointTrieError
Source§fn try_from(
reference: &'trie CodePointTrie<'trie, T>,
) -> Result<&'trie FastCodePointTrie<'trie, T>, TypedCodePointTrieError>
fn try_from( reference: &'trie CodePointTrie<'trie, T>, ) -> Result<&'trie FastCodePointTrie<'trie, T>, TypedCodePointTrieError>
Source§impl<'trie, T: TrieValue> TryFrom<CodePointTrie<'trie, T>> for FastCodePointTrie<'trie, T>
impl<'trie, T: TrieValue> TryFrom<CodePointTrie<'trie, T>> for FastCodePointTrie<'trie, T>
Source§type Error = TypedCodePointTrieError
type Error = TypedCodePointTrieError
Source§fn try_from(
value: CodePointTrie<'trie, T>,
) -> Result<FastCodePointTrie<'trie, T>, TypedCodePointTrieError>
fn try_from( value: CodePointTrie<'trie, T>, ) -> Result<FastCodePointTrie<'trie, T>, TypedCodePointTrieError>
Source§impl<'trie, T: TrieValue> TypedCodePointTrie<'trie, T> for FastCodePointTrie<'trie, T>
impl<'trie, T: TrieValue> TypedCodePointTrie<'trie, T> for FastCodePointTrie<'trie, T>
Source§fn as_untyped_ref(&self) -> &CodePointTrie<'trie, T>
fn as_untyped_ref(&self) -> &CodePointTrie<'trie, T>
Returns a reference to the wrapped CodePointTrie.
Source§fn to_untyped(self) -> CodePointTrie<'trie, T>
fn to_untyped(self) -> CodePointTrie<'trie, T>
Extracts the wrapped CodePointTrie.
Source§fn get16(&self, bmp: u16) -> T
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
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§fn get32_u32(&self, code_point: u32) -> u32
fn get32_u32(&self, code_point: u32) -> u32
u32 by Unicode Scalar Value without branching on trie type.Source§fn get8(&self, latin1: u8) -> T
fn get8(&self, latin1: u8) -> T
Source§unsafe fn get7(&self, ascii: u8) -> T
unsafe fn get7(&self, ascii: u8) -> T
Source§fn get32_supplementary(&self, supplementary: u32) -> T
fn get32_supplementary(&self, supplementary: u32) -> T
Source§fn get(&self, c: char) -> T
fn get(&self, c: char) -> T
Source§fn get32(&self, code_point: u32) -> T
fn get32(&self, code_point: u32) -> T
Source§fn get32_by_fast_index(&self, code_point: u32) -> Option<T>
fn get32_by_fast_index(&self, code_point: u32) -> Option<T>
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§impl<'yoke, T> Yokeable<'yoke> for FastCodePointTrie<'static, T>where
T: 'static + TrieValue,
impl<'yoke, T> Yokeable<'yoke> for FastCodePointTrie<'static, T>where
T: 'static + TrieValue,
Source§type Output = FastCodePointTrie<'yoke, T>
type Output = FastCodePointTrie<'yoke, T>
Self with the 'static replaced with 'a, i.e. Self<'a>Source§fn transform_owned(self) -> Self::Output
fn transform_owned(self) -> Self::Output
Source§impl<'zf, 'zf_inner, T: TrieValue> ZeroFrom<'zf, FastCodePointTrie<'zf_inner, T>> for FastCodePointTrie<'zf, T>
impl<'zf, 'zf_inner, T: TrieValue> ZeroFrom<'zf, FastCodePointTrie<'zf_inner, T>> for FastCodePointTrie<'zf, T>
Source§fn zero_from(this: &'zf FastCodePointTrie<'zf_inner, T>) -> Self
fn zero_from(this: &'zf FastCodePointTrie<'zf_inner, T>) -> Self
C into a struct that may retain references into C.