pub struct NoOpCacheProvider;
Expand description
No-op cache provider that doesn’t cache anything
Trait Implementations§
Source§impl CacheProvider for NoOpCacheProvider
impl CacheProvider for NoOpCacheProvider
Source§fn get<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_key: &'life1 (impl 'async_trait + CacheKey),
) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>where
T: DeserializeOwned + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_key: &'life1 (impl 'async_trait + CacheKey),
) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>where
T: DeserializeOwned + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a value from the cache
Source§fn set<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
_key: &'life1 (impl 'async_trait + CacheKey),
_value: &'life2 T,
_ttl: Option<Duration>,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
fn set<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, _key: &'life1 (impl 'async_trait + CacheKey), _value: &'life2 T, _ttl: Option<Duration>, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
Set a value in the cache with optional TTL
Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 (impl 'async_trait + CacheKey),
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 (impl 'async_trait + CacheKey),
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a value from the cache
Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear all values from the cache
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 (impl 'async_trait + CacheKey),
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 (impl 'async_trait + CacheKey),
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a key exists in the cache
Source§fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CacheStats> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CacheStats> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get cache statistics
Source§fn set_enabled(&mut self, _enabled: bool)
fn set_enabled(&mut self, _enabled: bool)
Set cache enabled/disabled state
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Check if cache is enabled
Source§impl Clone for NoOpCacheProvider
impl Clone for NoOpCacheProvider
Source§fn clone(&self) -> NoOpCacheProvider
fn clone(&self) -> NoOpCacheProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for NoOpCacheProvider
impl RefUnwindSafe for NoOpCacheProvider
impl Send for NoOpCacheProvider
impl Sync for NoOpCacheProvider
impl Unpin for NoOpCacheProvider
impl UnwindSafe for NoOpCacheProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more