pub struct QuickManager {
pub cache: Arc<Cache<String, Arc<Vec<u8>>>>,
}
Expand description
Implements CacheManager
with quick-cache
as the backend.
Fields§
§cache: Arc<Cache<String, Arc<Vec<u8>>>>
The instance of quick_cache::sync::Cache
Implementations§
Trait Implementations§
Source§impl CacheManager for QuickManager
impl CacheManager for QuickManager
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cache_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(HttpResponse, CachePolicy)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cache_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(HttpResponse, CachePolicy)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Attempts to pull a cached response and related policy from cache.
Source§fn put<'life0, 'async_trait>(
&'life0 self,
cache_key: String,
response: HttpResponse,
policy: CachePolicy,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
cache_key: String,
response: HttpResponse,
policy: CachePolicy,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Attempts to cache a response and related policy.
Source§impl Clone for QuickManager
impl Clone for QuickManager
Source§fn clone(&self) -> QuickManager
fn clone(&self) -> QuickManager
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for QuickManager
impl Debug for QuickManager
Auto Trait Implementations§
impl Freeze for QuickManager
impl !RefUnwindSafe for QuickManager
impl Send for QuickManager
impl Sync for QuickManager
impl Unpin for QuickManager
impl !UnwindSafe for QuickManager
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