#[non_exhaustive]pub enum LocaleFallbackPriority {
Language,
Region,
Collation,
}
Expand description
Hint for which subtag to prioritize during fallback.
For example, "en-US"
might fall back to either "en"
or "und-US"
depending
on this enum.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Language
Prioritize the language. This is the default behavior.
For example, "en-US"
should go to "en"
and then "und"
.
Region
Prioritize the region.
For example, "en-US"
should go to "und-US"
and then "und"
.
Collation
Collation-specific fallback rules. Similar to language priority.
For example, "zh-Hant"
goes to "zh"
before "und"
.
Implementations§
source§impl LocaleFallbackPriority
impl LocaleFallbackPriority
sourcepub const fn const_default() -> LocaleFallbackPriority
pub const fn const_default() -> LocaleFallbackPriority
Const-friendly version of Default::default
.
Trait Implementations§
source§impl Clone for LocaleFallbackPriority
impl Clone for LocaleFallbackPriority
source§fn clone(&self) -> LocaleFallbackPriority
fn clone(&self) -> LocaleFallbackPriority
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 moresource§impl Debug for LocaleFallbackPriority
impl Debug for LocaleFallbackPriority
source§impl Default for LocaleFallbackPriority
impl Default for LocaleFallbackPriority
source§fn default() -> LocaleFallbackPriority
fn default() -> LocaleFallbackPriority
Returns the “default value” for a type. Read more
source§impl Ord for LocaleFallbackPriority
impl Ord for LocaleFallbackPriority
source§fn cmp(&self, other: &LocaleFallbackPriority) -> Ordering
fn cmp(&self, other: &LocaleFallbackPriority) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for LocaleFallbackPriority
impl PartialEq for LocaleFallbackPriority
source§impl PartialOrd for LocaleFallbackPriority
impl PartialOrd for LocaleFallbackPriority
impl Copy for LocaleFallbackPriority
impl Eq for LocaleFallbackPriority
impl StructuralPartialEq for LocaleFallbackPriority
Auto Trait Implementations§
impl Freeze for LocaleFallbackPriority
impl RefUnwindSafe for LocaleFallbackPriority
impl Send for LocaleFallbackPriority
impl Sync for LocaleFallbackPriority
impl Unpin for LocaleFallbackPriority
impl UnwindSafe for LocaleFallbackPriority
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)