[][src]Struct fluent_templates::ArcLoader

pub struct ArcLoader { /* fields omitted */ }

A loader that uses Arc<FluentResource> as its backing storage. This is mainly useful for when you need to load fluent at run time. You can configure the initialisation with ArcLoaderBuilder.

use fluent_templates::{ArcLoader, FluentHelper};

let loader = ArcLoader::builder("locales/", unic_langid::langid!("en-US"))
    .shared_resources(Some(&["locales/core.ftl".into()]))
    .customize(|bundle| bundle.set_use_isolating(false))
    .build()
    .unwrap();

Implementations

impl ArcLoader[src]

pub fn builder<P: AsRef<Path> + ?Sized>(
    location: &P,
    fallback: LanguageIdentifier
) -> ArcLoaderBuilder
[src]

Creates a new ArcLoaderBuilder

pub fn locales(&self) -> Vec<LanguageIdentifier>[src]

Returns a Vec over the locales that were detected.

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

Trait Implementations

impl Loader for ArcLoader[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.