pub struct HttpCache {
pub directory: Option<String>,
pub cache: Arc<dyn HttpCacheStorage>,
pub max_size: u64,
}Fields§
§directory: Option<String>§cache: Arc<dyn HttpCacheStorage>§max_size: u64Implementations§
Trait Implementations§
Source§impl Storage for HttpCache
impl Storage for HttpCache
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 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
Source§fn as_any(&self) -> &(dyn Any + Send + Sync)
fn as_any(&self) -> &(dyn Any + Send + Sync)
Helper function to cast the trait object to concrete types
Source§fn lookup_streaming_write<'life0, 'life1, 'life2, 'async_trait>(
&'static self,
key: &'life0 CacheKey,
_streaming_write_tag: Option<&'life1 [u8]>,
trace: &'life2 SpanHandle<SpanContextState>,
) -> Pin<Box<dyn Future<Output = Result<Option<(CacheMeta, Box<dyn HandleHit + Send + Sync>)>, Box<Error>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + '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<SpanContextState>,
) -> Pin<Box<dyn Future<Output = Result<Option<(CacheMeta, Box<dyn HandleHit + Send + Sync>)>, Box<Error>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
Auto Trait Implementations§
impl Freeze for HttpCache
impl !RefUnwindSafe for HttpCache
impl Send for HttpCache
impl Sync for HttpCache
impl Unpin for HttpCache
impl UnsafeUnpin for HttpCache
impl !UnwindSafe for HttpCache
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