[][src]Trait locale_types::id::LocaleIdentifier

pub trait LocaleIdentifier where
    Self: Sized
{ fn new(language_code: String) -> LocaleResult<Self>;
fn with_language(&self, language_code: String) -> LocaleResult<Self>;
fn with_territory(&self, territory: String) -> LocaleResult<Self>;
fn with_code_set(&self, code_set: String) -> LocaleResult<Self>;
fn with_modifier(&self, modifier: String) -> LocaleResult<Self>;
fn with_modifiers<K, V>(
        &self,
        modifiers: HashMap<K, V>
    ) -> LocaleResult<Self>
    where
        K: Display,
        V: Display
;
fn language_code(&self) -> String;
fn territory(&self) -> Option<String>;
fn code_set(&self) -> Option<String>;
fn modifier(&self) -> Option<String>; }

Common trait for different kinds of locale identifier.

Required methods

fn new(language_code: String) -> LocaleResult<Self>

Construct a new identifier with the given language code only.

fn with_language(&self, language_code: String) -> LocaleResult<Self>

Return a new identifier based on self with a new language code.

fn with_territory(&self, territory: String) -> LocaleResult<Self>

Return a new identifier based on self with a new territory code.

fn with_code_set(&self, code_set: String) -> LocaleResult<Self>

Return a new identifier based on self with a new code_set code.

fn with_modifier(&self, modifier: String) -> LocaleResult<Self>

Return a new identifier based on self with a new modifier string.

fn with_modifiers<K, V>(&self, modifiers: HashMap<K, V>) -> LocaleResult<Self> where
    K: Display,
    V: Display

Return a new identifier based on self with a new modifier string.

fn language_code(&self) -> String

Return the current language code.

fn territory(&self) -> Option<String>

Return the current territory/country code.

fn code_set(&self) -> Option<String>

Return the current code set/charset code.

fn modifier(&self) -> Option<String>

Return the current modifier string.

Loading content...

Implementors

impl LocaleIdentifier for LocaleString[src]

Loading content...