pub struct CollationElement32(u32);Expand description
A compressed form of a collation element as stored in the collation data.
A CollationElement32 can be “normal” or “special”.
Bits 7 and 6 are case bits for the “normal” case and setting
both is an impossible case bit combination. Hence, “special”
CollationElement32s are marked by setting both case bits
to 1. This is equivalent with the low byte being less than
SPECIAL_CE32_LOW_BYTE (0xC0, i.e. 0b11000000) in the “normal”
case and equal to or greater in the “special” case.
For the normal case: Bits: 31..16: Primary weight Bits: 15..8: Secondary weight Bits: 7..6: Case bits (cannot both be 1 simultaneously) Bits: 5..0: The high part of the discontiguous tertiary weight (The quaternary weight and the low part of the discontiguous tertiary weight are zero.)
For the special case:
Bits 31..8: tag-specific; see the documentation for Tag.
Bits 7..6: The specialness marker; both bits set to 1
Bits 5..4: Reserved. May be used in the future to indicate lccc!=0 and tccc!=0.
Bits 3..0: the tag (bit-compatible with Tag)
Tuple Fields§
§0: u32Implementations§
Source§impl CollationElement32
impl CollationElement32
pub(crate) fn new_from_ule(ule: RawBytesULE<4>) -> Self
fn low_byte(self) -> u8
Sourcepub fn tag_checked(self) -> Option<Tag>
pub fn tag_checked(self) -> Option<Tag>
Return the tag in Some if special or None if not special.
Sourcepub(crate) fn tag(self) -> Tag
pub(crate) fn tag(self) -> Tag
Returns the tag if this element is special.
Non-specialness should first be checked by seeing if either
to_ce_simple_or_long_primary() or to_ce_self_contained()
returns non-None.
§Panics
Panics in debug mode if called on a non-special element.
Sourcepub(crate) fn to_primary_simple(self) -> u32
pub(crate) fn to_primary_simple(self) -> u32
Simplest possible check for the Latin1 fast path.
A return value of zero means no primary.
Sourcepub(crate) fn to_primary_in_quick_check(self, data: &CollationData<'_>) -> u32
pub(crate) fn to_primary_in_quick_check(self, data: &CollationData<'_>) -> u32
Extract only the first primary in the quick check without identical prefix.
A return value of zero means no primary.
Sourcepub(crate) fn to_primary_in_quick_check_numeric(
self,
data: &CollationData<'_>,
numeric: bool,
) -> u32
pub(crate) fn to_primary_in_quick_check_numeric( self, data: &CollationData<'_>, numeric: bool, ) -> u32
Extract only the first primary in the quick check after the identical
prefix. Unlike to_primary_in_quick_check, this method variant can
handle Tag::Digit if the numeric mode is not enabled. (The numeric
mode requires looking ahead.)
A return value of zero means no primary.
Sourcepub(crate) fn to_ce_simple_or_long_primary(self) -> Option<CollationElement>
pub(crate) fn to_ce_simple_or_long_primary(self) -> Option<CollationElement>
Expands to 64 bits if the expansion is to a single 64-bit collation element and is not a long-secondary expansion.
Sourcepub(crate) fn to_ce_self_contained(self) -> Option<CollationElement>
pub(crate) fn to_ce_self_contained(self) -> Option<CollationElement>
Expands to 64 bits if the expansion is to a single 64-bit collation element.
Sourcepub(crate) fn to_ce_self_contained_or_gigo(self) -> CollationElement
pub(crate) fn to_ce_self_contained_or_gigo(self) -> CollationElement
Expands to 64 bits if the expansion is to a single 64-bit collation element or otherwise returns the collation element for U+FFFD.
pub(crate) fn digit(self) -> u8
pub(crate) fn every_suffix_starts_with_combining(self) -> bool
pub(crate) fn at_least_one_suffix_contains_starter(self) -> bool
pub(crate) fn at_least_one_suffix_ends_with_non_starter(self) -> bool
Trait Implementations§
Source§impl Clone for CollationElement32
impl Clone for CollationElement32
Source§fn clone(&self) -> CollationElement32
fn clone(&self) -> CollationElement32
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more