Struct writium_cache::Cache [] [src]

pub struct Cache<T: 'static> { /* fields omitted */ }

Cache for each Writium Api. Any Writium Api can be composited with this struct for cache.

Methods

impl<T: 'static> Cache<T>
[src]

[src]

[src]

Get the object identified by given ID. If the object is not cached, try recovering its cache from provided source. If there is no space for another object, the last recently accessed cache will be disposed.

[src]

Get the object identified by given ID. If the object is not cached, error will be returned. If there is no space for another object, the last recently accessed cache will be disposed.

[src]

Remove the object identified by given ID.

[src]

The maximum number of items can be cached at a same time.

[src]

Get the number of items cached.

Trait Implementations

impl<T: Clone + 'static> Clone for Cache<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: 'static> Drop for Cache<T>
[src]

[src]

Implement drop so that modified cached data can be returned to source properly.