@@ -2,23 +2,31 @@ use intl_memoizer::{concurrent::IntlLangMemoizer, Memoizable};
2
2
use rustc_hash:: FxHashMap ;
3
3
use unic_langid:: LanguageIdentifier ;
4
4
5
- use crate :: bundle:: FluentBundle ;
6
5
use crate :: memoizer:: MemoizerKind ;
7
6
use crate :: types:: FluentType ;
8
7
9
- impl < R > FluentBundle < R , IntlLangMemoizer > {
8
+ /// Specialized [`FluentBundle`](crate::bundle::FluentBundle) over
9
+ /// concurrent [`IntlLangMemoizer`](intl_memoizer::concurrent::IntlLangMemoizer).
10
+ ///
11
+ /// A concurrent `FluentBundle` can be constructed with the
12
+ /// [`FluentBundle::new_concurrent`] method.
13
+ ///
14
+ /// See [`FluentBundle`](crate::FluentBundle) for the non-concurrent specialization.
15
+ pub type FluentBundle < R > = crate :: bundle:: FluentBundle < R , IntlLangMemoizer > ;
16
+
17
+ impl < R > FluentBundle < R > {
10
18
/// A constructor analogous to [`FluentBundle::new`] but operating
11
19
/// on a concurrent version of [`IntlLangMemoizer`] over [`Mutex`](std::sync::Mutex).
12
20
///
13
21
/// # Example
14
22
///
15
23
/// ```
16
- /// use fluent_bundle::bundle ::FluentBundle;
24
+ /// use fluent_bundle::concurrent ::FluentBundle;
17
25
/// use fluent_bundle::FluentResource;
18
26
/// use unic_langid::langid;
19
27
///
20
28
/// let langid_en = langid!("en-US");
21
- /// let mut bundle: FluentBundle<FluentResource, _ > =
29
+ /// let mut bundle: FluentBundle<FluentResource> =
22
30
/// FluentBundle::new_concurrent(vec![langid_en]);
23
31
/// ```
24
32
pub fn new_concurrent ( locales : Vec < LanguageIdentifier > ) -> Self {
0 commit comments