Skip to main content

TypedCodePointTrie

Trait TypedCodePointTrie 

Source
pub trait TypedCodePointTrie<'trie, T: TrieValue>: Seal {
    const TRIE_TYPE: TrieType;

    // Required methods
    fn as_untyped_ref(&self) -> &CodePointTrie<'trie, T>;
    fn to_untyped(self) -> CodePointTrie<'trie, T>;

    // Provided methods
    fn get32_u32(&self, code_point: u32) -> u32 { ... }
    fn get16(&self, bmp: u16) -> T { ... }
    fn get32_supplementary(&self, supplementary: u32) -> T { ... }
    fn get(&self, c: char) -> T { ... }
    fn get32(&self, code_point: u32) -> T { ... }
    fn get32_by_fast_index(&self, code_point: u32) -> Option<T> { ... }
}
Expand description

Trait for writing trait bounds for monomorphizing over either FastCodePointTrie or SmallCodePointTrie.

Required Associated Constants§

Source

const TRIE_TYPE: TrieType

The TrieType associated with this TypedCodePointTrie

§Safety Usable Invariant

This constant matches self.as_untyped_ref().header.trie_type.

Required Methods§

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.

Provided Methods§

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 get16(&self, bmp: u16) -> T

Lookup trie value by Basic Multilingual Plane Code Point 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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

Source§

const TRIE_TYPE: TrieType = TrieType::Fast

Source§

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

Source§

const TRIE_TYPE: TrieType = TrieType::Small