Struct noise::Cache [] [src]

pub struct Cache<Source, T> where
    T: Float
{ pub source: Source, // some fields omitted }

Noise module that caches the last output value generated by the source module.

If the input coordinates passed to Cache::get are equal to the previous call, the module returns the cached result of the previous call to Source::get. Otherwise, Source::get is called with the new coordinates, overwriting the cache with the result, and returning the result to the caller.

Caching a noise module is useful if it is used as a source module for multiple noise modules. If a source module is not cached, the source module will redundantly calculate the same output value once for each noise module in which it is included.

Fields

Outputs the value to be cached.

Methods

impl<Source, T> Cache<Source, T> where
    T: Float
[src]

Trait Implementations

impl<Source: Clone, T: Clone> Clone for Cache<Source, T> where
    T: Float
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<Source: Debug, T: Debug> Debug for Cache<Source, T> where
    T: Float
[src]

Formats the value using the given formatter.

impl<Source, T> NoiseModule<Point2<T>> for Cache<Source, T> where
    Source: NoiseModule<Point2<T>, Output = T>,
    T: Float
[src]

impl<Source, T> NoiseModule<Point3<T>> for Cache<Source, T> where
    Source: NoiseModule<Point3<T>, Output = T>,
    T: Float
[src]

impl<Source, T> NoiseModule<Point4<T>> for Cache<Source, T> where
    Source: NoiseModule<Point4<T>, Output = T>,
    T: Float
[src]