pub struct CachedCallbackNamespace<'a> { /* private fields */ }
Expand description

CachedCallbackNamespace is useful when your variable/function lookups are expensive.

Each variable+args combo will only be looked up once, and then it will be cached and re-used for subsequent lookups.

See module-level documentation for example.

Implementations

Trait Implementations

Creates a new cached entry. If an entry with the same name already exists, an AlreadyExists Error is returned. Read more

Sets a cached entry. It doesn’t matter whether or not a previous value existed with this name. Read more

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

Returns a cached value if possible, otherwise delegates to the callback function.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.