pub struct LocaleChain(/* private fields */);Expand description
Ordered locale fallback chain.
Implementations§
Source§impl LocaleChain
impl LocaleChain
Builds a locale chain and appends global fallback when absent.
Sourcepub fn from_cli(raw: &str) -> Result<LocaleChain, LocaleError>
pub fn from_cli(raw: &str) -> Result<LocaleChain, LocaleError>
Parses a comma-separated CLI locale chain.
Sourcepub fn merge_policy_and_cli(
policy: Option<&[LocaleTag]>,
cli: Option<&[LocaleTag]>,
) -> LocaleChain
pub fn merge_policy_and_cli( policy: Option<&[LocaleTag]>, cli: Option<&[LocaleTag]>, ) -> LocaleChain
Merges policy and CLI locale preferences.
Sourcepub fn merge_cli_policy_rulepack_default(
cli: Option<&[LocaleTag]>,
policy: Option<&[LocaleTag]>,
rulepack_defaults: Option<&[LocaleTag]>,
) -> LocaleChain
pub fn merge_cli_policy_rulepack_default( cli: Option<&[LocaleTag]>, policy: Option<&[LocaleTag]>, rulepack_defaults: Option<&[LocaleTag]>, ) -> LocaleChain
Merges CLI, policy, rulepack, and default locale preferences.
Sourcepub fn intersects(&self, recognizer_locales: &[LocaleTag]) -> bool
pub fn intersects(&self, recognizer_locales: &[LocaleTag]) -> bool
Returns true when a recognizer can run under this locale chain.
Sourcepub fn to_strings(&self) -> Vec<String>
pub fn to_strings(&self) -> Vec<String>
Returns the locale chain as canonical strings.
Trait Implementations§
Source§impl Clone for LocaleChain
impl Clone for LocaleChain
Source§fn clone(&self) -> LocaleChain
fn clone(&self) -> LocaleChain
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LocaleChain
impl Debug for LocaleChain
Source§impl From<&[LocaleTag]> for LocaleChain
impl From<&[LocaleTag]> for LocaleChain
Source§fn from(tags: &[LocaleTag]) -> LocaleChain
fn from(tags: &[LocaleTag]) -> LocaleChain
Converts to this type from the input type.
Source§impl PartialEq for LocaleChain
impl PartialEq for LocaleChain
Source§fn eq(&self, other: &LocaleChain) -> bool
fn eq(&self, other: &LocaleChain) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for LocaleChain
impl StructuralPartialEq for LocaleChain
Auto Trait Implementations§
impl Freeze for LocaleChain
impl RefUnwindSafe for LocaleChain
impl Send for LocaleChain
impl Sync for LocaleChain
impl Unpin for LocaleChain
impl UnsafeUnpin for LocaleChain
impl UnwindSafe for LocaleChain
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.