[][src]Struct unic_locale::Locale

pub struct Locale {
    pub langid: LanguageIdentifier,
    pub extensions: HashMap<ExtensionType, HashMap<String, String>>,
}

Fields

langid: LanguageIdentifierextensions: 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]

pub fn matches(
    &self,
    other: &Self,
    self_as_range: bool,
    other_as_range: bool
) -> bool
[src]

pub fn get_language(&self) -> &str[src]

pub fn set_language(
    &mut self,
    language: Option<&str>
) -> Result<(), LocaleError>
[src]

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]

Trait Implementations

impl Into<LanguageIdentifier> for Locale[src]

impl PartialEq<Locale> for Locale[src]

impl From<LanguageIdentifier> for Locale[src]

impl Default for Locale[src]

impl Debug for Locale[src]

impl Display for Locale[src]

Auto Trait Implementations

impl Send for Locale

impl Sync for Locale

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]