Trait Cached

Source
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 EvalNamespaces.

Implement this trait if your Namespace type uses a cache.

Required Methods§

Source

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.

Source

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.

Source

fn cache_clear(&mut self)

Clear all cached entries. Values will be recalculated and cached again the next time they are looked up.

Implementors§