[−][src]Struct lightspeed_cache::Cache
Methods
impl<K: Hash + Eq, V> Cache<K, V>
[src]
pub fn new(ttl_seconds: u32) -> Self
[src]
pub fn get(&self, key: &K) -> Option<Arc<V>>
[src]
pub fn get_or_insert_with<F: FnOnce() -> V>(&self, key: K, default: F) -> Arc<V>
[src]
pub fn get_or_try_insert_with<F: FnOnce() -> Result<V, E>, E>(
&self,
key: K,
default: F
) -> Result<Arc<V>, E>
[src]
&self,
key: K,
default: F
) -> Result<Arc<V>, E>
pub fn insert(&self, key: K, value: V)
[src]
pub fn remove(&self, key: &K)
[src]
Trait Implementations
impl<K: Hash + Eq, V> Clone for Cache<K, V>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<K, V> !RefUnwindSafe for Cache<K, V>
impl<K, V> Send for Cache<K, V> where
K: Send + Sync,
V: Send + Sync,
K: Send + Sync,
V: Send + Sync,
impl<K, V> Sync for Cache<K, V> where
K: Send + Sync,
V: Send + Sync,
K: Send + Sync,
V: Send + Sync,
impl<K, V> Unpin for Cache<K, V>
impl<K, V> !UnwindSafe for Cache<K, V>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,