Struct cached::UnboundCache[][src]

pub struct UnboundCache<K, V> { /* fields omitted */ }
Expand description

Default unbounded cache

This cache has no size limit or eviction policy.

Note: This cache is in-memory only

Implementations

Creates an empty UnboundCache

Creates an empty UnboundCache with a given pre-allocated capacity

Trait Implementations

Attempt to retrieve a cached value

Attempt to retrieve a cached value with mutable access

Insert a key, value pair and return the previous value

Get or insert a key, value pair

Remove a cached value

Remove all cached values. Keeps the allocated memory for reuse.

Remove all cached values. Free memory and return to initial state

Reset misses/hits counters

Return the current cache size (number of elements)

Return the number of times a cached value was successfully retrieved

Return the number of times a cached value was unable to be retrieved

Return the cache capacity

Return the lifespan of cached values (time to eviction)

Set the lifespan of cached values, returns the old value

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.