[][src]Struct unic_locale_macros::Locale

pub struct Locale {
    pub langid: LanguageIdentifier,
    pub extensions: ExtensionsMap,
}

Fields

langid: LanguageIdentifierextensions: ExtensionsMap

Methods

impl Locale[src]

pub fn from_parts<S>(
    language: Option<S>,
    script: Option<S>,
    region: Option<S>,
    variants: Option<&[S]>,
    extensions: Option<ExtensionsMap>
) -> Result<Locale, LocaleError> where
    S: AsRef<str>, 
[src]

pub fn from_parts_unchecked(
    language: Option<&'static str>,
    script: Option<&'static str>,
    region: Option<&'static str>,
    variants: Option<&[&'static str]>,
    extensions: Option<ExtensionsMap>
) -> Locale
[src]

pub fn matches<O>(
    &self,
    other: &O,
    self_as_range: bool,
    other_as_range: bool
) -> bool where
    O: AsRef<Locale>, 
[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<&str>[src]

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

pub fn get_region(&self) -> Option<&str>[src]

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

pub fn get_variants(&self) -> Vec<&str>[src]

pub fn set_variants(&mut self, variants: &[&str]) -> Result<(), LocaleError>[src]

pub fn set_extension(
    &mut self,
    extension: ExtensionType,
    key: &str,
    value: Option<&str>
) -> Result<(), LocaleError>
[src]

pub fn get_extensions(&self) -> &ExtensionsMap[src]

Trait Implementations

impl From<LanguageIdentifier> for Locale[src]

impl Default for Locale[src]

impl Debug for Locale[src]

impl FromStr for Locale[src]

type Err = LocaleError

The associated error which can be returned from parsing.

impl PartialEq<Locale> for Locale[src]

impl Display for Locale[src]

impl Clone for Locale[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Into<LanguageIdentifier> for Locale[src]

impl AsRef<LanguageIdentifier> for Locale[src]

impl AsRef<Locale> for Locale[src]

Auto Trait Implementations

impl Sync for Locale

impl Send for Locale

impl Unpin for Locale

impl RefUnwindSafe for Locale

impl UnwindSafe for Locale

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[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]