pub struct Texts { /* private fields */ }Expand description
The texts of a catalog in one language.
Implementations§
Source§impl Texts
impl Texts
Sourcepub fn new(language: Language) -> Texts
pub fn new(language: Language) -> Texts
The texts that come with the framework, in this language.
Sourcepub fn of(catalog: Catalog, language: impl Into<String>) -> Texts
pub fn of(catalog: Catalog, language: impl Into<String>) -> Texts
Those of this catalog, in the language of this code, which may be one the framework does not come with.
Sourcepub fn get(&self, key: &str) -> String
pub fn get(&self, key: &str) -> String
The text of a key, falling back to English, and to the key itself when nobody has it.
Sourcepub fn char(&self, key: &str, otherwise: char) -> char
pub fn char(&self, key: &str, otherwise: char) -> char
The first character of the text of a key, or this when there is none.
Sourcepub fn list(&self, key: &str) -> Vec<String>
pub fn list(&self, key: &str) -> Vec<String>
The texts under key.0, key.1… as many as there are.
Sourcepub fn array<const N: usize>(&self, key: &str) -> [String; N]
pub fn array<const N: usize>(&self, key: &str) -> [String; N]
The texts under key.0 to key.{N-1}.
Sourcepub fn pair_list(&self, key: &str) -> Vec<(String, String)>
pub fn pair_list(&self, key: &str) -> Vec<(String, String)>
The pairs under key.0, key.1… as many as there are, each with its .0 and .1.
Trait Implementations§
impl Eq for Texts
impl StructuralPartialEq for Texts
Auto Trait Implementations§
impl Freeze for Texts
impl RefUnwindSafe for Texts
impl Send for Texts
impl Sync for Texts
impl Unpin for Texts
impl UnsafeUnpin for Texts
impl UnwindSafe for Texts
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> Brush for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.