Struct rust_cache::hash_map::HashMapCache
[−]
[src]
pub struct HashMapCache { /* fields omitted */ }
Methods
impl HashMapCache
[src]
This cache allows for in memory caching. this can be useful for really simple caching requirements where you dont want to have to use a filesystem or some external storage but still want caching
fn new() -> Self
Trait Implementations
impl Cache for HashMapCache
[src]
type Error = Error
fn fetch<T: Cacheable>(
&mut self,
key: &String
) -> Result<Option<T>, Self::Error>
&mut self,
key: &String
) -> Result<Option<T>, Self::Error>
fn save<T: Cacheable>(
&mut self,
key: &String,
item: &T,
ttl: Duration
) -> Result<(), Self::Error>
&mut self,
key: &String,
item: &T,
ttl: Duration
) -> Result<(), Self::Error>