[][src]Enum mouscache::Cache

pub enum Cache {
    Memory(MemoryCache),
    Redis(RedisCache),
}

Variants

Memory(MemoryCache)Redis(RedisCache)

Methods

impl Cache[src]

pub fn insert<K: ToString, O: Cacheable + Clone + 'static>(
    &self,
    key: K,
    obj: O
) -> Result<()>
[src]

pub fn insert_with<K: ToString, O: Cacheable + Clone + 'static>(
    &self,
    key: K,
    obj: O,
    expires_after: Option<usize>
) -> Result<()>
[src]

pub fn get<K: ToString, O: Cacheable + Clone + 'static>(
    &self,
    key: K
) -> Result<Option<O>>
[src]

pub fn remove<K: ToString, O: Cacheable>(&self, key: K) -> Result<()>[src]

Trait Implementations

impl CacheFunc for Cache[src]

impl Send for Cache[src]

impl Sync for Cache[src]

impl Clone for Cache[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T