pub struct LanguagePreferences { /* private fields */ }Expand description
Language preferences for a user
Returned from lang_prefs()
Fields are sorted in order of the user’s preference.
POSIX locale values and GNU nonstandard categories are defined in https://man7.org/linux/man-pages/man7/locale.7.html. Windows locale values are defined in https://learn.microsoft.com/en-us/cpp/c-runtime-library/locale-categories.
Implementations§
Source§impl LanguagePreferences
impl LanguagePreferences
Sourcepub fn collation_langs(&self) -> impl Iterator<Item = Language> + '_
pub fn collation_langs(&self) -> impl Iterator<Item = Language> + '_
Returns the collation langs of this LanguagePreferences in order of
the user’s preference
Collation langs are used for sorting and regular expressions, including character equivalence classes and multicharacter collating elements.
Sourcepub fn char_class_langs(&self) -> impl Iterator<Item = Language> + '_
pub fn char_class_langs(&self) -> impl Iterator<Item = Language> + '_
Returns the char class langs of this LanguagePreferences in order of
the user’s preference
Char class langs determine the interpretation of byte sequences as characters (e.g., single versus multibyte characters), character classifications (e.g., alphabetic or digit), and the behavior of character classes.
Sourcepub fn monetary_langs(&self) -> impl Iterator<Item = Language> + '_
pub fn monetary_langs(&self) -> impl Iterator<Item = Language> + '_
Returns the monetary langs of this LanguagePreferences in order of
the user’s preference
Monetary langs determine the formatting used for monetary-related numeric values, i.e, the way numbers are usually printed with details such as decimal point versus decimal comma.
For nonmonetary numeric values, see
LanguagePreferences::numeric_langs
Sourcepub fn message_langs(&self) -> impl Iterator<Item = Language> + '_
pub fn message_langs(&self) -> impl Iterator<Item = Language> + '_
Returns the messages langs of this LanguagePreferences in order of
the user’s preference
Message determines the language in which messages are displayed and what an affirmative or negative answer looks like.
Sourcepub fn numeric_langs(&self) -> impl Iterator<Item = Language> + '_
pub fn numeric_langs(&self) -> impl Iterator<Item = Language> + '_
Returns the numeric langs of this LanguagePreferences in order of
the user’s preference
Numeric langs determine the formatting rules used for nonmonetary numeric values. For example, the thousands separator and the radix character.
For monetary formatting, see LanguagePreferences::monetary_langs.
Sourcepub fn time_langs(&self) -> impl Iterator<Item = Language> + '_
pub fn time_langs(&self) -> impl Iterator<Item = Language> + '_
Returns the time langs of this LanguagePreferences in order of the
user’s preference
Time langs determine format and contents of date and time information.
Trait Implementations§
Source§impl Clone for LanguagePreferences
impl Clone for LanguagePreferences
Source§fn clone(&self) -> LanguagePreferences
fn clone(&self) -> LanguagePreferences
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more