pub struct FallbackKey { /* private fields */ }Expand description
Describes a selector for fallback families.
This is a Script and optionally, a locale, represented
as a &'static str.
It can be constructed directly via FallbackKey::new or any of
a variety of From implementations to improve the ease of use.
Implementations§
Source§impl FallbackKey
impl FallbackKey
Sourcepub fn new(
script: impl Into<Script>,
locale: Option<&LanguageIdentifier>,
) -> Self
pub fn new( script: impl Into<Script>, locale: Option<&LanguageIdentifier>, ) -> Self
Creates a new fallback key from the given script and locale.
Sourcepub fn locale(&self) -> Option<&'static str>
pub fn locale(&self) -> Option<&'static str>
Returns a normalized version of the requested locale.
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Returns true if the requested locale is considered the “default”
language/region for the requested script.
Always returns true when locale returns None.
Sourcepub fn is_tracked(&self) -> bool
pub fn is_tracked(&self) -> bool
Returns true if the requested script and locale pair are actually
tracked for fallback.
Trait Implementations§
Source§impl Clone for FallbackKey
impl Clone for FallbackKey
Source§fn clone(&self) -> FallbackKey
fn clone(&self) -> FallbackKey
Returns a duplicate 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 FallbackKey
impl Debug for FallbackKey
Source§impl<S> From<(S, &LanguageIdentifier)> for FallbackKey
impl<S> From<(S, &LanguageIdentifier)> for FallbackKey
Source§fn from(value: (S, &LanguageIdentifier)) -> Self
fn from(value: (S, &LanguageIdentifier)) -> Self
Converts to this type from the input type.
Source§impl<S> From<(S, &str)> for FallbackKey
impl<S> From<(S, &str)> for FallbackKey
Source§impl<S> From<S> for FallbackKey
impl<S> From<S> for FallbackKey
Source§impl Hash for FallbackKey
impl Hash for FallbackKey
Source§impl PartialEq for FallbackKey
impl PartialEq for FallbackKey
impl Copy for FallbackKey
impl Eq for FallbackKey
impl StructuralPartialEq for FallbackKey
Auto Trait Implementations§
impl Freeze for FallbackKey
impl RefUnwindSafe for FallbackKey
impl Send for FallbackKey
impl Sync for FallbackKey
impl Unpin for FallbackKey
impl UnwindSafe for FallbackKey
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.