pub trait EvaluationContext: Send + 'static {
type Rng: Rng;
// Required methods
fn get_rng(&mut self) -> Self::Rng;
fn now(&self) -> DateTime<Utc>;
fn evaluation_start(&mut self);
fn cache_get<K: Serialize, C: DeserializeOwned>(
&mut self,
key: &K,
) -> Result<Option<C>>;
fn cache_set<K: Serialize, C: Serialize>(
&mut self,
key: &K,
content: &C,
) -> Result<()>;
}
Expand description
Context passed through builtin evaluation
Required Associated Types§
Required Methods§
Sourcefn evaluation_start(&mut self)
fn evaluation_start(&mut self)
Notify the context on evaluation start, so it can clean itself up
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.