pub struct FileHttpCache<T>{ /* private fields */ }Expand description
File-backed HTTP cache with a Fjall metadata index.
Layout under the provided base directory:
index/: Fjall keyspace storing cache metadata keyed by cache keyfiles/YYYY/MM/DD/*.json: full serializedCacheEntry<T>payloads
Implementations§
Source§impl<T> FileHttpCache<T>
impl<T> FileHttpCache<T>
Trait Implementations§
Source§impl<T> Debug for FileHttpCache<T>
impl<T> Debug for FileHttpCache<T>
Source§impl<T> HttpCache<T> for FileHttpCache<T>
impl<T> HttpCache<T> for FileHttpCache<T>
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CacheEntry<T>>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CacheEntry<T>>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a value from cache
Source§fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: T,
status_code: u16,
state: CacheEntryState,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: T,
status_code: u16,
state: CacheEntryState,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Set or update a value in cache
Source§fn update_state<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
state: CacheEntryState,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_state<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
state: CacheEntryState,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update entry state
Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove entry from cache
Auto Trait Implementations§
impl<T> !Freeze for FileHttpCache<T>
impl<T> !RefUnwindSafe for FileHttpCache<T>
impl<T> !UnwindSafe for FileHttpCache<T>
impl<T> Send for FileHttpCache<T>where
PhantomData<T>: Send,
impl<T> Sync for FileHttpCache<T>where
PhantomData<T>: Sync,
impl<T> Unpin for FileHttpCache<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for FileHttpCache<T>where
PhantomData<T>: UnsafeUnpin,
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