pub trait AbstractCodePointTrie<'trie, T: TrieValue>: Seal {
// Required methods
unsafe fn ascii(&self, ascii: u8) -> T;
unsafe fn utf8_two_byte(&self, high_five: u32, low_six: u32) -> T;
unsafe fn utf8_three_byte(&self, high_ten: u32, low_six: u32) -> T;
fn latin1(&self, latin1: u8) -> T;
fn bmp(&self, bmp: u16) -> T;
fn supplementary(&self, supplementary: u32) -> T;
fn scalar(&self, scalar: char) -> T;
fn code_point(&self, code_point: u32) -> T;
}Expand description
Trait for writing trait bounds for monomorphizing over either
CodePointTrie, FastCodePointTrie, or SmallCodePointTrie.
Method naming intentionally differs from the method naming on those types in order to disambiguate.
Required Methods§
Sourceunsafe 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
Look up trie value by a two-byte UTF-8 sequence.
high_five is the low five bits of the lead byte of a two-byte UTF-8 sequence.
low_six is the low six bits of the trail byte of a two-byte UTF-8 sequence.
§Safety
high_five must not have bit positions other than the lowest 5 set to 1.
low_six must not have bit positions other than the lowest 6 set to 1.
Sourceunsafe 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
Look up trie value by 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.
Sourcefn bmp(&self, bmp: u16) -> T
fn bmp(&self, bmp: u16) -> T
Look up trie value by a Basic Multilingual Plane character.
Surrogate values are allowed.
Sourcefn supplementary(&self, supplementary: u32) -> T
fn supplementary(&self, supplementary: u32) -> T
Look up trie value by a non-Basic Multilingual Plane character.
The behavior is memory-safe nonsense if the argument is not actually a non-Basic Multilingual Plane character.
Sourcefn code_point(&self, code_point: u32) -> T
fn code_point(&self, code_point: u32) -> T
Look up trie value by Unicode Code Point.
Surrogate values are allowed. Out of range input results in the error value.