Trait locale::LocaleFactory [] [src]

pub trait LocaleFactory {
    fn get_numeric(&mut self) -> Option<Box<Numeric>> { ... }
    fn get_time(&mut self) -> Option<Box<Time>> { ... }
}

Trait defining how to obtain various components of a locale.

Use implementation of this trait to construct parts of the Locale object.

There may be various methods for obtaining locale data. The lowest common denominator is standard C library. It is however quite limited and some systems (notably Android) don't actually contain the corresponding data. Many systems also provide additional configurability for the locale setting (Windows, KDE, etc.) that are only accessible via that system's specific interface. So this trait exists to allow combining the methods for obtaining the data.

The implementations for individual locale categories are returned boxed, because they may need to be polymorphic and in options to allow combining partial implementations. Creating locale data is not a performance critical operation, so dynamic polymrphism is used for sake of simplicity.

All methods default to simply returning None, again so partial implementations that delegate to another factory are possible. See CompositeLocaleFactory.

Provided Methods

Get implementation of the Numeric locale category.

Get implementation of the Time locale category.

Implementors