pub struct MemCache { /* private fields */ }
Expand description
Hash map based in memory cache
For testing only, not for production use.
Implementations§
Trait Implementations§
Source§impl Storage for MemCache
impl Storage for MemCache
Source§fn lookup<'life0, 'life1, 'async_trait>(
&'static self,
key: &'life0 CacheKey,
_trace: &'life1 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<Option<(CacheMeta, HitHandler)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn lookup<'life0, 'life1, 'async_trait>(
&'static self,
key: &'life0 CacheKey,
_trace: &'life1 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<Option<(CacheMeta, HitHandler)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lookup the storage for the given CacheKey.
Source§fn lookup_streaming_write<'life0, 'life1, 'life2, 'async_trait>(
&'static self,
key: &'life0 CacheKey,
streaming_write_tag: Option<&'life1 [u8]>,
_trace: &'life2 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<Option<(CacheMeta, HitHandler)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn lookup_streaming_write<'life0, 'life1, 'life2, 'async_trait>(
&'static self,
key: &'life0 CacheKey,
streaming_write_tag: Option<&'life1 [u8]>,
_trace: &'life2 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<Option<(CacheMeta, HitHandler)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn get_miss_handler<'life0, 'life1, 'life2, 'async_trait>(
&'static self,
key: &'life0 CacheKey,
meta: &'life1 CacheMeta,
_trace: &'life2 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<MissHandler>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_miss_handler<'life0, 'life1, 'life2, 'async_trait>(
&'static self,
key: &'life0 CacheKey,
meta: &'life1 CacheMeta,
_trace: &'life2 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<MissHandler>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Write the given CacheMeta to the storage. Return MissHandler to write the body later.
Source§fn purge<'life0, 'life1, 'async_trait>(
&'static self,
key: &'life0 CompactCacheKey,
_type: PurgeType,
_trace: &'life1 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn purge<'life0, 'life1, 'async_trait>(
&'static self,
key: &'life0 CompactCacheKey,
_type: PurgeType,
_trace: &'life1 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete the cached asset for the given key Read more
Source§fn update_meta<'life0, 'life1, 'life2, 'async_trait>(
&'static self,
key: &'life0 CacheKey,
meta: &'life1 CacheMeta,
_trace: &'life2 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_meta<'life0, 'life1, 'life2, 'async_trait>(
&'static self,
key: &'life0 CacheKey,
meta: &'life1 CacheMeta,
_trace: &'life2 SpanHandle,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update cache header and metadata for the already stored asset.
Source§fn support_streaming_partial_write(&self) -> bool
fn support_streaming_partial_write(&self) -> bool
Whether this storage backend supports reading partially written data Read more
Auto Trait Implementations§
impl !Freeze for MemCache
impl !RefUnwindSafe for MemCache
impl Send for MemCache
impl Sync for MemCache
impl Unpin for MemCache
impl !UnwindSafe for MemCache
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