[][src]Struct noise::Cache

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

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

If the input coordinates passed to Cache::get are equal to the previous call, the function 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 function is useful if it is used as a source function for multiple noise functions. If a source function is not cached, the source function will redundantly calculate the same output value once for each noise function in which it is included.

Fields

source: Source

Outputs the value to be cached.

Methods

impl<Source> Cache<Source>[src]

pub fn new(source: Source) -> Self[src]

Trait Implementations

impl<Source> NoiseFn<[f64; 2]> for Cache<Source> where
    Source: NoiseFn<Point2<f64>>, 
[src]

impl<Source> NoiseFn<[f64; 3]> for Cache<Source> where
    Source: NoiseFn<Point3<f64>>, 
[src]

impl<Source> NoiseFn<[f64; 4]> for Cache<Source> where
    Source: NoiseFn<Point4<f64>>, 
[src]

impl<Source: Clone> Clone for Cache<Source>[src]

impl<Source: Debug> Debug for Cache<Source>[src]

Auto Trait Implementations

impl<Source> Send for Cache<Source> where
    Source: Send

impl<Source> Unpin for Cache<Source> where
    Source: Unpin

impl<Source> !Sync for Cache<Source>

impl<Source> UnwindSafe for Cache<Source> where
    Source: UnwindSafe

impl<Source> !RefUnwindSafe for Cache<Source>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T