pub struct Language {
pub id: &'static LanguageIdentifier,
pub name: &'static str,
pub dir: &'static WritingDirection,
pub flag: Option<&'static str>,
}Expand description
Each language supported by your application.
Fields§
§id: &'static LanguageIdentifierLanguage identifier
Can be any valid language tag, such as en, es, en-US, es-ES, etc.
name: &'static strLanguage name
The name of the language, such as English, Español, etc.
This name will be intended to be displayed in the language selector.
dir: &'static WritingDirectionWriting direction of the language
flag: Option<&'static str>Flag of the country of the language as emoji (if any)
Implementations§
Trait Implementations§
Source§impl AttributeValue for &Language
impl AttributeValue for &Language
Source§type State = <String as AttributeValue>::State
type State = <String as AttributeValue>::State
The state that should be retained between building and rebuilding.
Source§type AsyncOutput = String
type AsyncOutput = String
The type once all async data have loaded.
Source§type Cloneable = String
type Cloneable = String
A version of the value that can be cloned. This can be the same type, or a
reference-counted type. Generally speaking, this does not need to refer to the same data,
but should behave in the same way. So for example, making an event handler cloneable should
probably make it reference-counted (so that a
FnMut() continues mutating the same
closure), but making a String cloneable does not necessarily need to make it an
Arc<str>, as two different clones of a String will still have the same value.Source§type CloneableOwned = String
type CloneableOwned = String
A cloneable type that is also
'static. This is used for spreading across types when the
spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned
cloneable type has worse performance than the cloneable type, so they are separate.Source§fn to_template(_key: &str, _buf: &mut String)
fn to_template(_key: &str, _buf: &mut String)
Renders the attribute value to HTML for a
<template>.Source§fn hydrate<const FROM_SERVER: bool>(
self,
key: &str,
el: &Element,
) -> Self::State
fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> Self::State
Adds interactivity as necessary, given DOM nodes that were created from HTML that has
either been rendered on the server, or cloned for a
<template>.Source§fn build(self, el: &Element, key: &str) -> Self::State
fn build(self, el: &Element, key: &str) -> Self::State
Adds this attribute to the element during client-side rendering.
Source§fn into_cloneable(self) -> Self::Cloneable
fn into_cloneable(self) -> Self::Cloneable
Converts this attribute into an equivalent that can be cloned.
Source§fn into_cloneable_owned(self) -> Self::CloneableOwned
fn into_cloneable_owned(self) -> Self::CloneableOwned
Converts this attributes into an equivalent that can be cloned and is
'static.Source§fn dry_resolve(&mut self)
fn dry_resolve(&mut self)
“Runs” the attribute without other side effects. For primitive types, this is a no-op. For
reactive types, this can be used to gather data about reactivity or about asynchronous data
that needs to be loaded.
Source§async fn resolve(self) -> Self::AsyncOutput
async fn resolve(self) -> Self::AsyncOutput
“Resolves” this into a form that is not waiting for any asynchronous data.
Source§impl<'a, Inner> PartialEq<ReadGuard<&'a Language, Inner>> for &Language
impl<'a, Inner> PartialEq<ReadGuard<&'a Language, Inner>> for &Language
impl Eq for Language
Auto Trait Implementations§
impl Freeze for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnwindSafe for Language
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§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§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 moreSource§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.