pub struct Translations { /* private fields */ }Implementations§
Source§impl Translations
impl Translations
Source§impl Translations
impl Translations
Source§impl Translations
impl Translations
pub fn new(languages: &[&str]) -> Result<Self, TranslationError>
Sourcepub fn add(
&mut self,
module: &str,
language: &str,
source: &str,
) -> Result<(), TranslationError>
pub fn add( &mut self, module: &str, language: &str, source: &str, ) -> Result<(), TranslationError>
Its texts replace a framework crate’s; two app modules may not define one key.
Sourcepub fn add_builtin(
&mut self,
module: &str,
files: &[(&str, &str)],
) -> Result<(), TranslationError>
pub fn add_builtin( &mut self, module: &str, files: &[(&str, &str)], ) -> Result<(), TranslationError>
A language the app does not declare is not offered, and the app’s own texts win.
pub fn add_enum( &mut self, name: &str, variants: &[(&str, Tone)], ) -> Result<(), TranslationError>
pub fn languages(&self) -> &[Locale]
pub fn keys(&self) -> Vec<&str>
Trait Implementations§
Auto Trait Implementations§
impl Forget for Translations
impl Freeze for Translations
impl RefUnwindSafe for Translations
impl Send for Translations
impl Sync for Translations
impl Unpin for Translations
impl UnsafeUnpin for Translations
impl UnwindSafe for Translations
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