Struct icu_collator::options::CollatorOptionsBitField
source · pub(crate) struct CollatorOptionsBitField(u32);
Tuple Fields§
§0: u32
Implementations§
source§impl CollatorOptionsBitField
impl CollatorOptionsBitField
sourceconst STRENGTH_MASK: u32 = 7u32
const STRENGTH_MASK: u32 = 7u32
Bits 0..2 : Strength
sourceconst ALTERNATE_HANDLING_MASK: u32 = 8u32
const ALTERNATE_HANDLING_MASK: u32 = 8u32
Bits 3..4 : Alternate handling: 00 non-ignorable, 01 shifted, 10 reserved for shift-trimmed, 11 reserved for blanked. In other words, bit 4 is currently always 0.
sourceconst MAX_VARIABLE_MASK: u32 = 96u32
const MAX_VARIABLE_MASK: u32 = 96u32
Bits 5..6 : 2-bit max variable value to be shifted by MAX_VARIABLE_SHIFT
.
const MAX_VARIABLE_SHIFT: u32 = 5u32
sourceconst UPPER_FIRST_MASK: u32 = 256u32
const UPPER_FIRST_MASK: u32 = 256u32
Bit 7 : Reserved for extending max variable. Bit 8 : Sort uppercase first if case level or case first is on.
sourceconst CASE_FIRST_MASK: u32 = 512u32
const CASE_FIRST_MASK: u32 = 512u32
Bit 9 : Keep the case bits in the tertiary weight (they trump other tertiary values) unless case level is on (when they are moved into the separate case level). By default, the case bits are removed from the tertiary weight (ignored). When CASE_FIRST is off, UPPER_FIRST must be off too, corresponding to the tri-value UCOL_CASE_FIRST attribute: UCOL_OFF vs. UCOL_LOWER_FIRST vs. UCOL_UPPER_FIRST.
sourceconst CASE_LEVEL_MASK: u32 = 1_024u32
const CASE_LEVEL_MASK: u32 = 1_024u32
Bit 10 : Insert the case level between the secondary and tertiary levels.
sourceconst BACKWARD_SECOND_LEVEL_MASK: u32 = 2_048u32
const BACKWARD_SECOND_LEVEL_MASK: u32 = 2_048u32
Bit 11 : Backward secondary level
sourceconst NUMERIC_MASK: u32 = 4_096u32
const NUMERIC_MASK: u32 = 4_096u32
Bit 12 : Numeric
sourceconst EXPLICIT_STRENGTH_MASK: u32 = 2_147_483_648u32
const EXPLICIT_STRENGTH_MASK: u32 = 2_147_483_648u32
Whether strength is explicitly set.
sourceconst EXPLICIT_MAX_VARIABLE_MASK: u32 = 1_073_741_824u32
const EXPLICIT_MAX_VARIABLE_MASK: u32 = 1_073_741_824u32
Whether max variable is explicitly set.
sourceconst EXPLICIT_ALTERNATE_HANDLING_MASK: u32 = 536_870_912u32
const EXPLICIT_ALTERNATE_HANDLING_MASK: u32 = 536_870_912u32
Whether alternate handling is explicitly set.
sourceconst EXPLICIT_CASE_LEVEL_MASK: u32 = 268_435_456u32
const EXPLICIT_CASE_LEVEL_MASK: u32 = 268_435_456u32
Whether case level is explicitly set.
sourceconst EXPLICIT_CASE_FIRST_MASK: u32 = 134_217_728u32
const EXPLICIT_CASE_FIRST_MASK: u32 = 134_217_728u32
Whether case first is explicitly set.
sourceconst EXPLICIT_BACKWARD_SECOND_LEVEL_MASK: u32 = 67_108_864u32
const EXPLICIT_BACKWARD_SECOND_LEVEL_MASK: u32 = 67_108_864u32
Whether backward secondary is explicitly set.
sourceconst EXPLICIT_NUMERIC_MASK: u32 = 33_554_432u32
const EXPLICIT_NUMERIC_MASK: u32 = 33_554_432u32
Whether numeric is explicitly set.
sourcepub fn set_strength(&mut self, strength: Option<Strength>)
pub fn set_strength(&mut self, strength: Option<Strength>)
This is the BCP47 key ks
. See the enum for examples.
sourcepub fn max_variable(&self) -> MaxVariable
pub fn max_variable(&self) -> MaxVariable
The maximum character class that AlternateHandling::Shifted
applies to.
sourcepub fn set_max_variable(&mut self, max_variable: Option<MaxVariable>)
pub fn set_max_variable(&mut self, max_variable: Option<MaxVariable>)
The maximum character class that AlternateHandling::Shifted
applies to. See the enum for examples.
sourcepub fn alternate_handling(&self) -> AlternateHandling
pub fn alternate_handling(&self) -> AlternateHandling
Whether certain characters are moved from the primary level to the quaternary level.
sourcepub fn set_alternate_handling(
&mut self,
alternate_handling: Option<AlternateHandling>,
)
pub fn set_alternate_handling( &mut self, alternate_handling: Option<AlternateHandling>, )
Whether certain characters are moved from the primary level to the quaternary level. See the enum for examples.
sourcepub fn case_level(&self) -> bool
pub fn case_level(&self) -> bool
Whether there’s a dedicated case level.
sourcepub fn set_case_level(&mut self, case_level: Option<bool>)
pub fn set_case_level(&mut self, case_level: Option<bool>)
Whether there’s a dedicated case level. If true
, detaches
the case aspect of the tertiary level and inserts it between
the secondary and tertiary levels. Can be combined with the
primary-only strength. Setting this to true
with
Strength::Primary
corresponds to the ECMA-402 sensitivity
“case”.
See the ICU guide.
pub fn set_case_level_from_enum(&mut self, case_level: Option<CaseLevel>)
fn case_first(&self) -> CaseFirst
sourcepub fn set_case_first(&mut self, case_first: Option<CaseFirst>)
pub fn set_case_first(&mut self, case_first: Option<CaseFirst>)
Whether case is the most significant part of the tertiary level.
See the ICU guide.
sourcepub fn backward_second_level(&self) -> bool
pub fn backward_second_level(&self) -> bool
Whether second level compares the last accent difference instead of the first accent difference.
sourcepub fn set_backward_second_level(&mut self, backward_second_level: Option<bool>)
pub fn set_backward_second_level(&mut self, backward_second_level: Option<bool>)
Whether second level compares the last accent difference instead of the first accent difference.
pub fn set_backward_second_level_from_enum( &mut self, backward_second_level: Option<BackwardSecondLevel>, )
sourcepub fn numeric(&self) -> bool
pub fn numeric(&self) -> bool
Whether sequences of decimal digits are compared according to their numeric value.
sourcepub fn set_numeric(&mut self, numeric: Option<bool>)
pub fn set_numeric(&mut self, numeric: Option<bool>)
Whether sequences of decimal digits are compared according to their numeric value.
pub fn set_numeric_from_enum(&mut self, numeric: Option<Numeric>)
sourcepub(crate) fn tertiary_mask(&self) -> Option<u16>
pub(crate) fn tertiary_mask(&self) -> Option<u16>
If strength is <= secondary, returns None
.
Otherwise, returns the appropriate mask.
sourcepub(crate) fn upper_first(&self) -> bool
pub(crate) fn upper_first(&self) -> bool
Internal upper first getter
sourcepub fn set_defaults(&mut self, other: CollatorOptionsBitField)
pub fn set_defaults(&mut self, other: CollatorOptionsBitField)
For options left as defaults in this CollatorOptions
,
set the value from other
. Values taken from other
are marked as explicitly set if they were explicitly
set in other
.
Trait Implementations§
source§impl Clone for CollatorOptionsBitField
impl Clone for CollatorOptionsBitField
source§fn clone(&self) -> CollatorOptionsBitField
fn clone(&self) -> CollatorOptionsBitField
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more