[−][src]Struct fluent_templates::ArcLoader
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; 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]
location: &P,
fallback: LanguageIdentifier
) -> ArcLoaderBuilder
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]
&self,
lang: &LanguageIdentifier,
text_id: &str,
args: Option<&HashMap<String, FluentValue>>
) -> Option<String>
Convenience function to look up a string for a single language
Trait Implementations
impl Loader for ArcLoader[src]
fn lookup_complete(
&self,
lang: &LanguageIdentifier,
text_id: &str,
args: Option<&HashMap<String, FluentValue>>
) -> String[src]
&self,
lang: &LanguageIdentifier,
text_id: &str,
args: Option<&HashMap<String, FluentValue>>
) -> String
fn lookup(&self, lang: &LanguageIdentifier, text_id: &str) -> String[src]
fn lookup_with_args(
&self,
lang: &LanguageIdentifier,
text_id: &str,
args: &HashMap<String, FluentValue>
) -> String[src]
&self,
lang: &LanguageIdentifier,
text_id: &str,
args: &HashMap<String, FluentValue>
) -> String
Auto Trait Implementations
impl !RefUnwindSafe for ArcLoader
impl Send for ArcLoader
impl Sync for ArcLoader
impl Unpin for ArcLoader
impl !UnwindSafe for ArcLoader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,