Struct turbine_reactive::Cache [] [src]

pub struct Cache<T> {
    pub points1: HashMap<usize, Option<T>>,
    pub points2: HashMap<usize, Option<[T; 2]>>,
    pub points3: HashMap<usize, Option<[T; 3]>>,
    pub points4: HashMap<usize, Option<[T; 4]>>,
}

Used to store temporary values of shared functions to speed up computation. By default, all function outputs that are referenced more than once are cached. To signal that some function output should be cached, None is stored in a hash map. When performing the first computation of that output, Some(value) is stored in the cache.

Fields

Stores temporary values of scalars.

Stores temporary values of 2D vectors.

Stores temporary values of 3D vectors.

Stores temporary values of 4D vectors.

Methods

impl<T> Cache<T>
[src]

[src]

Creates a new cache for a document.

Analyzes the graph to find function outputs that are referenced more than once.

If new data and functions are added after the cache is created, then these will not be automatically cached, but the behavior should be the same.

[src]

Reset cache such that new temporary values can be calculated.