Struct calc_graph::Lazy [−][src]
pub struct Lazy<T, F>(_);
Calculates a node's value by calling a function on demand and caching the result.
Trait Implementations
impl<T: Clone, F: FnOnce() -> T> Calc for Lazy<T, F>
[src]
impl<T: Clone, F: FnOnce() -> T> Calc for Lazy<T, F>
type Value = T
The type of values calculated by the node.
fn add_dep(&mut self, _seen: &mut BitSet, _dep: usize)
[src]
fn add_dep(&mut self, _seen: &mut BitSet, _dep: usize)
When this node is used as a precedent, add_dep
is called by dependent nodes when they are created. Read more
fn eval(&mut self, _dirty: &mut BitSet) -> (usize, T)
[src]
fn eval(&mut self, _dirty: &mut BitSet) -> (usize, T)
Returns the value held within the node and the version number of the inputs used to calcuate that value. The value is recalculated if needed. Read more