#[non_exhaustive]pub struct CollatorPreferences {
pub locale_preferences: LocalePreferences,
pub collation_type: Option<CollationType>,
pub case_first: Option<CollationCaseFirst>,
pub numeric_ordering: Option<CollationNumericOrdering>,
}
Expand description
The preferences for collation.
§Preferences
Examples for using the different preferences below can be found in the crate-level docs.
§Case First
See the spec.
This is the BCP47 key kf
. Three possibilities: CollationCaseFirst::False
(default,
except for Danish and Maltese), CollationCaseFirst::Lower
, and CollationCaseFirst::Upper
(default for Danish and Maltese).
§Numeric
This is the BCP47 key kn
. When set to CollationNumericOrdering::True
, any sequence of decimal
digits (General_Category = Nd) is sorted at the primary level according to the
numeric value. The default is CollationNumericOrdering::False
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.locale_preferences: LocalePreferences
Locale Preferences for the Preferences structure.
collation_type: Option<CollationType>
The collation type. This corresponds to the -u-co
BCP-47 tag.
case_first: Option<CollationCaseFirst>
Treatment of case. (Large and small kana differences are treated as case differences.)
This corresponds to the -u-kf
BCP-47 tag.
numeric_ordering: Option<CollationNumericOrdering>
When set to True
, any sequence of decimal digits is sorted at a primary level according
to the numeric value.
This corresponds to the -u-kn
BPC-47 tag.
Implementations§
Source§impl CollatorPreferences
impl CollatorPreferences
Sourcepub fn extend(&mut self, other: CollatorPreferences)
pub fn extend(&mut self, other: CollatorPreferences)
Extends the preferences with the values from another set of preferences.
Trait Implementations§
Source§impl Clone for CollatorPreferences
impl Clone for CollatorPreferences
Source§fn clone(&self) -> CollatorPreferences
fn clone(&self) -> CollatorPreferences
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CollatorPreferences
impl Debug for CollatorPreferences
Source§impl Default for CollatorPreferences
impl Default for CollatorPreferences
Source§fn default() -> CollatorPreferences
fn default() -> CollatorPreferences
Source§impl From<&LanguageIdentifier> for CollatorPreferences
impl From<&LanguageIdentifier> for CollatorPreferences
Source§fn from(lid: &LanguageIdentifier) -> CollatorPreferences
fn from(lid: &LanguageIdentifier) -> CollatorPreferences
Source§impl From<&Locale> for CollatorPreferences
impl From<&Locale> for CollatorPreferences
Source§fn from(loc: &Locale) -> CollatorPreferences
fn from(loc: &Locale) -> CollatorPreferences
Source§impl From<LanguageIdentifier> for CollatorPreferences
impl From<LanguageIdentifier> for CollatorPreferences
Source§fn from(lid: LanguageIdentifier) -> CollatorPreferences
fn from(lid: LanguageIdentifier) -> CollatorPreferences
Source§impl From<Locale> for CollatorPreferences
impl From<Locale> for CollatorPreferences
Source§fn from(loc: Locale) -> CollatorPreferences
fn from(loc: Locale) -> CollatorPreferences
Source§impl From<ResolvedCollatorOptions> for CollatorPreferences
impl From<ResolvedCollatorOptions> for CollatorPreferences
Source§fn from(options: ResolvedCollatorOptions) -> CollatorPreferences
fn from(options: ResolvedCollatorOptions) -> CollatorPreferences
Convenience conversion for copying the preferences from an existing collator into a new one.
Note that some preferences may not be fully preserved when recovering them
from an already initialized collator e.g LocalePreferences
and CollationType
, because
those are only relevant when loading the collation data.
Source§impl Hash for CollatorPreferences
impl Hash for CollatorPreferences
Source§impl PartialEq for CollatorPreferences
impl PartialEq for CollatorPreferences
impl Copy for CollatorPreferences
impl Eq for CollatorPreferences
impl StructuralPartialEq for CollatorPreferences
Auto Trait Implementations§
impl Freeze for CollatorPreferences
impl RefUnwindSafe for CollatorPreferences
impl Send for CollatorPreferences
impl Sync for CollatorPreferences
impl Unpin for CollatorPreferences
impl UnwindSafe for CollatorPreferences
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more