mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-04 18:29:29 +02:00
18 lines
540 B
Rust
18 lines
540 B
Rust
use crate::types::FluentType;
|
|
use intl_memoizer::Memoizable;
|
|
use unic_langid::LanguageIdentifier;
|
|
|
|
pub trait MemoizerKind: 'static {
|
|
fn new(lang: LanguageIdentifier) -> Self
|
|
where
|
|
Self: Sized;
|
|
|
|
fn with_try_get_threadsafe<I, R, U>(&self, args: I::Args, cb: U) -> Result<R, I::Error>
|
|
where
|
|
Self: Sized,
|
|
I: Memoizable + Send + Sync + 'static,
|
|
I::Args: Send + Sync + 'static,
|
|
U: FnOnce(&I) -> R;
|
|
|
|
fn stringify_value(&self, value: &dyn FluentType) -> std::borrow::Cow<'static, str>;
|
|
}
|