1use crate::types::FluentType;
2use intl_memoizer::Memoizable;
3use unic_langid::LanguageIdentifier;
4
5pub trait MemoizerKind: 'static {
6 fn new(lang: LanguageIdentifier) -> Self
7 where
8 Self: Sized;
9
10 fn with_try_get_threadsafe<I, R, U>(&self, args: I::Args, cb: U) -> Result<R, I::Error>
11 where
12 Self: Sized,
13 I: Memoizable + Send + Sync + 'static,
14 I::Args: Send + Sync + 'static,
15 U: FnOnce(&I) -> R;
16
17 fn stringify_value(&self, value: &dyn FluentType) -> std::borrow::Cow<'static, str>;
18}
19