/// Specialized [`FluentBundle`](crate::bundle::FluentBundle) over /// concurrent [`IntlLangMemoizer`]. /// /// A concurrent `FluentBundle` can be constructed with the /// [`FluentBundle::new_concurrent`] method. /// /// See [`FluentBundle`](crate::FluentBundle) for the non-concurrent specialization. pubtype FluentBundle<R> = crate::bundle::FluentBundle<R, IntlLangMemoizer>;
impl<R> FluentBundle<R> { /// A constructor analogous to [`FluentBundle::new`] but operating /// on a concurrent version of [`IntlLangMemoizer`] over [`Mutex`](std::sync::Mutex). /// /// # Example /// /// ``` /// use fluent_bundle::concurrent::FluentBundle; /// use fluent_bundle::FluentResource; /// use unic_langid::langid; /// /// let langid_en = langid!("en-US"); /// let mut bundle: FluentBundle<FluentResource> = /// FluentBundle::new_concurrent(vec![langid_en]); /// ``` pubfn new_concurrent(locales: Vec<LanguageIdentifier>) -> Self { let first_locale = locales.first().cloned().unwrap_or_default(); Self {
locales,
resources: vec![],
entries: FxHashMap::default(),
intls: IntlLangMemoizer::new(first_locale),
use_isolating: true,
transform: None,
formatter: None,
}
}
}
impl MemoizerKind for IntlLangMemoizer { fn new(lang: LanguageIdentifier) -> Self where Self: Sized,
{ Self::new(lang)
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.