Struct icu_collator::elements::CharacterAndClass
source · struct CharacterAndClass(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: u32
Implementations§
source§impl CharacterAndClass
impl CharacterAndClass
pub fn new(c: char, ccc: CanonicalCombiningClass) -> Self
pub fn new_with_placeholder(c: char) -> Self
pub fn new_with_trie_value(c: char, trie_value: u32) -> Self
pub fn character(&self) -> char
pub fn ccc(&self) -> CanonicalCombiningClass
pub fn character_and_ccc(&self) -> (char, CanonicalCombiningClass)
pub fn set_ccc_from_trie_if_not_already_set( &mut self, trie: &CodePointTrie<'_, u32>, )
Trait Implementations§
source§impl Clone for CharacterAndClass
impl Clone for CharacterAndClass
source§fn clone(&self) -> CharacterAndClass
fn clone(&self) -> CharacterAndClass
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for CharacterAndClass
impl RefUnwindSafe for CharacterAndClass
impl Send for CharacterAndClass
impl Sync for CharacterAndClass
impl Unpin for CharacterAndClass
impl UnwindSafe for CharacterAndClass
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more