pub struct StaticLoader { /* private fields */ }
Expand description
A simple Loader implementation, with statically-loaded fluent data.
Typically created with the static_loader!()
macro
Implementations§
Source§impl StaticLoader
impl StaticLoader
Sourcepub fn new(
bundles: &'static HashMap<LanguageIdentifier, FluentBundle<&'static FluentResource>>,
fallbacks: &'static HashMap<LanguageIdentifier, Vec<LanguageIdentifier>>,
fallback: LanguageIdentifier,
) -> Self
pub fn new( bundles: &'static HashMap<LanguageIdentifier, FluentBundle<&'static FluentResource>>, fallbacks: &'static HashMap<LanguageIdentifier, Vec<LanguageIdentifier>>, fallback: LanguageIdentifier, ) -> Self
Construct a StaticLoader
You should probably be using the constructor from static_loader!()
Sourcepub fn lookup_single_language(
&self,
lang: &LanguageIdentifier,
text_id: &str,
args: Option<&HashMap<&str, FluentValue<'_>>>,
) -> Option<String>
pub fn lookup_single_language( &self, lang: &LanguageIdentifier, text_id: &str, args: Option<&HashMap<&str, FluentValue<'_>>>, ) -> Option<String>
Convenience function to look up a string for a single language
Sourcepub fn lookup_no_default_fallback(
&self,
lang: &LanguageIdentifier,
text_id: &str,
args: Option<&HashMap<&str, FluentValue<'_>>>,
) -> Option<String>
pub fn lookup_no_default_fallback( &self, lang: &LanguageIdentifier, text_id: &str, args: Option<&HashMap<&str, FluentValue<'_>>>, ) -> Option<String>
Convenience function to look up a string without falling back to the default fallback language
Trait Implementations§
Source§impl Loader for StaticLoader
impl Loader for StaticLoader
fn lookup( &self, lang: &LanguageIdentifier, text_id: &str, args: Option<&HashMap<&str, FluentValue<'_>>>, ) -> String
Auto Trait Implementations§
impl Freeze for StaticLoader
impl !RefUnwindSafe for StaticLoader
impl Send for StaticLoader
impl Sync for StaticLoader
impl Unpin for StaticLoader
impl !UnwindSafe for StaticLoader
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