Struct matrix_sdk::oidc::types::registration::Localized
pub struct Localized<T> { /* private fields */ }
Available on crate feature
experimental-oidc
only.Expand description
A collection of localized variants.
Always includes one non-localized variant.
Implementations§
§impl<T> Localized<T>
impl<T> Localized<T>
pub fn new(
non_localized: T,
localized: impl IntoIterator<Item = (LanguageTag, T)>
) -> Localized<T>
pub fn new( non_localized: T, localized: impl IntoIterator<Item = (LanguageTag, T)> ) -> Localized<T>
Constructs a new Localized
with the given non-localized and localized
variants.
pub fn non_localized(&self) -> &T
pub fn non_localized(&self) -> &T
Get the non-localized variant.
pub fn to_non_localized(self) -> T
pub fn to_non_localized(self) -> T
Get the non-localized variant.
pub fn get(&self, language: Option<&LanguageTag>) -> Option<&T>
pub fn get(&self, language: Option<&LanguageTag>) -> Option<&T>
Get the variant corresponding to the given language, if it exists.
pub fn iter(&self) -> impl Iterator<Item = (Option<&LanguageTag>, &T)>
pub fn iter(&self) -> impl Iterator<Item = (Option<&LanguageTag>, &T)>
Get an iterator over the variants.
Trait Implementations§
§impl<T> From<(T, HashMap<LanguageTag, T>)> for Localized<T>
impl<T> From<(T, HashMap<LanguageTag, T>)> for Localized<T>
§fn from(t: (T, HashMap<LanguageTag, T>)) -> Localized<T>
fn from(t: (T, HashMap<LanguageTag, T>)) -> Localized<T>
Converts to this type from the input type.
§impl<T> PartialEq for Localized<T>where
T: PartialEq,
impl<T> PartialEq for Localized<T>where
T: PartialEq,
impl<T> Eq for Localized<T>where
T: Eq,
impl<T> StructuralPartialEq for Localized<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Localized<T>where
T: RefUnwindSafe,
impl<T> Send for Localized<T>where
T: Send,
impl<T> Sync for Localized<T>where
T: Sync,
impl<T> Unpin for Localized<T>where
T: Unpin,
impl<T> UnwindSafe for Localized<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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§fn clone_handle(handle: Handle) -> Handle
fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>