[][src]Struct unic_locale::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: &[S],
    extensions: Option<ExtensionsMap>
) -> Result<Locale, LocaleError> where
    S: AsRef<str>, 
[src]

pub fn into_raw_parts(
    self
) -> (Option<u64>, Option<u32>, Option<u32>, Option<Box<[u64]>>, String)
[src]

pub unsafe fn from_raw_parts_unchecked(
    language: Option<TinyStr8>,
    script: Option<TinyStr4>,
    region: Option<TinyStr4>,
    variants: Option<Box<[TinyStr8]>>,
    extensions: 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 get_character_direction(&self) -> CharacterDirection[src]

Trait Implementations

impl AsRef<LanguageIdentifier> for Locale[src]

impl AsRef<Locale> for Locale[src]

impl Debug for Locale[src]

impl Display for Locale[src]

impl Clone for Locale[src]

impl Into<LanguageIdentifier> for Locale[src]

impl Default for Locale[src]

impl FromStr for Locale[src]

type Err = LocaleError

The associated error which can be returned from parsing.

impl From<LanguageIdentifier> for Locale[src]

impl PartialEq<Locale> for Locale[src]

Auto Trait Implementations

impl Sync for Locale

impl Send for Locale

impl Unpin for Locale

impl UnwindSafe for Locale

impl RefUnwindSafe 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> 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> 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]