pub trait Cached {
// Required methods
fn cache_create(&mut self, name: String, val: f64) -> Result<(), Error>;
fn cache_set(&mut self, name: String, val: f64);
fn cache_clear(&mut self);
}
Expand description
Cache operations for EvalNamespace
s.
Implement this trait if your Namespace type uses a cache.
Required Methods§
Sourcefn cache_create(&mut self, name: String, val: f64) -> Result<(), Error>
fn cache_create(&mut self, name: String, val: f64) -> Result<(), Error>
Creates a new cached entry. If an entry with the same name already
exists, an AlreadyExists
Error is returned.
Sourcefn cache_set(&mut self, name: String, val: f64)
fn cache_set(&mut self, name: String, val: f64)
Sets a cached entry. It doesn’t matter whether or not a previous value existed with this name.
Sourcefn cache_clear(&mut self)
fn cache_clear(&mut self)
Clear all cached entries. Values will be recalculated and cached again the next time they are looked up.