[][src]Struct simple_cache::Cache

pub struct Cache<K> { /* fields omitted */ }

Implementations

impl<K> Cache<K> where
    K: Eq + Hash
[src]

pub fn new() -> Self[src]

pub async fn get<T: 'static + CacheItem, Q: ?Sized, '_, '_>(
    &'_ self,
    key: &'_ Q
) -> Option<Option<Arc<T>>> where
    K: Borrow<Q>,
    Q: Hash + Eq
[src]

pub async fn insert<T: 'static + CacheItem, '_>(
    &'_ self,
    key: K,
    value: Option<T>
) -> CacheResult
[src]

pub async fn remove<Q: ?Sized, '_, '_>(&'_ self, key: &'_ Q) -> CacheResult where
    K: Borrow<Q>,
    Q: Hash + Eq
[src]

Trait Implementations

impl<K: Clone> Clone for Cache<K>[src]

impl<K> Default for Cache<K> where
    K: Eq + Hash
[src]

Auto Trait Implementations

impl<K> !RefUnwindSafe for Cache<K>

impl<K> Send for Cache<K> where
    K: Send + Sync

impl<K> Sync for Cache<K> where
    K: Send + Sync

impl<K> Unpin for Cache<K>

impl<K> !UnwindSafe for Cache<K>

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.