[][src]Struct fluent_templates::StaticLoader

pub struct StaticLoader { /* fields omitted */ }

A simple Loader implementation, with statically-loaded fluent data. Typically created with the [static_loader!()] macro

Implementations

impl StaticLoader[src]

pub fn new(
    bundles: &'static HashMap<LanguageIdentifier, FluentBundle<&'static FluentResource>>,
    fallbacks: &'static HashMap<LanguageIdentifier, Vec<LanguageIdentifier>>,
    fallback: LanguageIdentifier
) -> Self
[src]

Construct a new StaticLoader.

This is exposed as publicly so that it can be used inside the static_loader! macro. it's not meant to be called directly.

pub fn lookup_single_language(
    &self,
    lang: &LanguageIdentifier,
    text_id: &str,
    args: Option<&HashMap<String, FluentValue>>
) -> Option<String>
[src]

Convenience function to look up a string for a single language

pub fn lookup_no_default_fallback(
    &self,
    lang: &LanguageIdentifier,
    text_id: &str,
    args: Option<&HashMap<String, FluentValue>>
) -> Option<String>
[src]

Convenience function to look up a string without falling back to the default fallback language

Trait Implementations

impl Loader for StaticLoader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.