pub struct Locale {
pub data: DataFormat,
pub strings: HashMap<String, Vec<String>>,
pub plural_fn: Arc<dyn Fn(u32) -> usize + Send + Sync>,
pub name: String,
}Fields§
§data: DataFormat§strings: HashMap<String, Vec<String>>§plural_fn: Arc<dyn Fn(u32) -> usize + Send + Sync>§name: StringImplementations§
Source§impl Locale
impl Locale
pub fn load(path: &Path, name: &str) -> Self
pub fn t<'a>(&'a self, key: &'a str) -> &'a str
pub fn plural_word<'a>(&'a self, key: &'a str, n: u32) -> &'a str
pub fn format_date(&self, date: Option<NaiveDate>) -> String
pub fn format_money(&self, amount: f64) -> String
pub fn format_numeric(&self, number: f64) -> String
pub fn compare(&self, a: &str, b: &str) -> i32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Locale
impl !RefUnwindSafe for Locale
impl Send for Locale
impl Sync for Locale
impl Unpin for Locale
impl !UnwindSafe for Locale
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more