pub(crate) struct CharacterAndClass(pub(crate) u32);Expand description
Pack a char and a CanonicalCombiningClass in
32 bits (the former in the lower 24 bits and the
latter in the high 8 bits). The latter can be
initialized to 0xFF upon creation, in which case
it can be actually set later by calling
set_ccc_from_trie_if_not_already_set. This is
a micro optimization to avoid the Canonical
Combining Class trie lookup when there is only
one combining character in a sequence. This type
is intentionally non-Copy to get compiler help
in making sure that the class is set on the
instance on which it is intended to be set
and not on a temporary copy.
Note that 0xFF is won’t be assigned to an actual canonical combining class per definition D104 in The Unicode Standard.
Tuple Fields§
§0: u32Implementations§
Source§impl<'data> CharacterAndClass
impl<'data> CharacterAndClass
pub fn new(c: char, ccc: CanonicalCombiningClass) -> Self
pub fn new_with_placeholder(c: char) -> Self
pub fn new_with_trie_value(c_tv: CharacterAndTrieValue) -> Self
pub fn new_starter(c: char) -> Self
Sourcepub fn character(&self) -> char
pub fn character(&self) -> char
This method must exist for Pernosco to apply its special rendering. Also, this must not be dead code!
Sourcepub fn ccc(&self) -> CanonicalCombiningClass
pub fn ccc(&self) -> CanonicalCombiningClass
This method must exist for Pernosco to apply its special rendering.