pub struct LocalizedClaim<T>(/* private fields */);
Expand description
A locale-aware claim.
This structure associates one more Option<LanguageTag>
locales with the corresponding
claims values.
Implementations§
Source§impl<T> LocalizedClaim<T>
impl<T> LocalizedClaim<T>
Sourcepub fn contains_key(&self, locale: Option<&LanguageTag>) -> bool
pub fn contains_key(&self, locale: Option<&LanguageTag>) -> bool
Returns true if the claim contains a value for the specified locale.
Sourcepub fn get(&self, locale: Option<&LanguageTag>) -> Option<&T>
pub fn get(&self, locale: Option<&LanguageTag>) -> Option<&T>
Returns the entry for the specified locale or None
if there is no such entry.
Sourcepub fn iter(&self) -> impl Iterator<Item = (Option<&LanguageTag>, &T)>
pub fn iter(&self) -> impl Iterator<Item = (Option<&LanguageTag>, &T)>
Returns an iterator over the locales and claim value entries.
Sourcepub fn insert(&mut self, locale: Option<LanguageTag>, value: T) -> Option<T>
pub fn insert(&mut self, locale: Option<LanguageTag>, value: T) -> Option<T>
Inserts or updates an entry for the specified locale.
Returns the current value associated with the given locale, or None
if there is no
such entry.
Sourcepub fn remove(&mut self, locale: Option<&LanguageTag>) -> Option<T>
pub fn remove(&mut self, locale: Option<&LanguageTag>) -> Option<T>
Removes an entry for the specified locale.
Returns the current value associated with the given locale, or None
if there is no
such entry.
Trait Implementations§
Source§impl<T: Clone> Clone for LocalizedClaim<T>
impl<T: Clone> Clone for LocalizedClaim<T>
Source§fn clone(&self) -> LocalizedClaim<T>
fn clone(&self) -> LocalizedClaim<T>
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<T: Debug> Debug for LocalizedClaim<T>
impl<T: Debug> Debug for LocalizedClaim<T>
Source§impl<T> Default for LocalizedClaim<T>
impl<T> Default for LocalizedClaim<T>
Source§impl<T> From<T> for LocalizedClaim<T>
impl<T> From<T> for LocalizedClaim<T>
Source§impl<T> FromIterator<(Option<LanguageTag>, T)> for LocalizedClaim<T>
impl<T> FromIterator<(Option<LanguageTag>, T)> for LocalizedClaim<T>
Source§fn from_iter<I: IntoIterator<Item = (Option<LanguageTag>, T)>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = (Option<LanguageTag>, T)>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<T> IntoIterator for LocalizedClaim<T>where
T: 'static,
impl<T> IntoIterator for LocalizedClaim<T>where
T: 'static,
Source§impl<T: PartialEq> PartialEq for LocalizedClaim<T>
impl<T: PartialEq> PartialEq for LocalizedClaim<T>
impl<T: Eq> Eq for LocalizedClaim<T>
impl<T> StructuralPartialEq for LocalizedClaim<T>
Auto Trait Implementations§
impl<T> Freeze for LocalizedClaim<T>where
T: Freeze,
impl<T> RefUnwindSafe for LocalizedClaim<T>where
T: RefUnwindSafe,
impl<T> Send for LocalizedClaim<T>where
T: Send,
impl<T> Sync for LocalizedClaim<T>where
T: Sync,
impl<T> Unpin for LocalizedClaim<T>where
T: Unpin,
impl<T> UnwindSafe for LocalizedClaim<T>where
T: UnwindSafe,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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