[−][src]Struct unic_locale::Locale
Fields
langid: LanguageIdentifier
extensions: HashMap<ExtensionType, HashMap<String, String>>
Methods
impl Locale
[src]
pub fn new() -> Self
[src]
pub fn from_str(ident: &str) -> Result<Self, LocaleError>
[src]
pub fn from_str_with_options(
ident: &str,
options: HashMap<&str, &str>
) -> Result<Self, LocaleError>
[src]
ident: &str,
options: HashMap<&str, &str>
) -> Result<Self, LocaleError>
pub fn matches(
&self,
other: &Self,
self_as_range: bool,
other_as_range: bool
) -> bool
[src]
&self,
other: &Self,
self_as_range: bool,
other_as_range: bool
) -> bool
pub fn get_language(&self) -> &str
[src]
pub fn set_language(
&mut self,
language: Option<&str>
) -> Result<(), LocaleError>
[src]
&mut self,
language: Option<&str>
) -> Result<(), LocaleError>
pub fn get_script(&self) -> &Option<String>
[src]
pub fn set_script(&mut self, script: Option<&str>) -> Result<(), LocaleError>
[src]
pub fn get_region(&self) -> &Option<String>
[src]
pub fn set_region(&mut self, region: Option<&str>) -> Result<(), LocaleError>
[src]
pub fn get_variants(&self) -> &[String]
[src]
pub fn set_variants(&mut self, variants: &[&str]) -> Result<(), LocaleError>
[src]
pub fn set_extension(
&mut self,
extension: ExtensionType,
key: &str,
value: &str
) -> Result<(), LocaleError>
[src]
&mut self,
extension: ExtensionType,
key: &str,
value: &str
) -> Result<(), LocaleError>
Trait Implementations
impl Into<LanguageIdentifier> for Locale
[src]
fn into(self) -> LanguageIdentifier
[src]
impl PartialEq<Locale> for Locale
[src]
impl From<LanguageIdentifier> for Locale
[src]
fn from(langid: LanguageIdentifier) -> Self
[src]
impl Default for Locale
[src]
impl Debug for Locale
[src]
impl Display for Locale
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,