pub struct FileStore { /* private fields */ }Expand description
Persistent store: one <hash>.bin (value) and <hash>.json (metadata)
pair per key. Writes are atomic (write to a temp file, then rename).
Tag invalidation scans the metadata files, so it is O(entries); this is adequate for single-node deployments. Use a networked store for fleets.
Implementations§
Trait Implementations§
Source§impl CacheStore for FileStore
impl CacheStore for FileStore
fn get<'a>( &'a self, key: &'a CacheKey, ) -> Pin<Box<dyn Future<Output = Result<Option<CacheEntry>, CacheError>> + Send + 'a>>
fn set( &self, key: CacheKey, entry: CacheEntry, ) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + '_>>
fn delete<'a>( &'a self, key: &'a CacheKey, ) -> Pin<Box<dyn Future<Output = Result<bool, CacheError>> + Send + 'a>>
Source§fn delete_tag<'a>(
&'a self,
tag: &'a str,
) -> Pin<Box<dyn Future<Output = Result<usize, CacheError>> + Send + 'a>>
fn delete_tag<'a>( &'a self, tag: &'a str, ) -> Pin<Box<dyn Future<Output = Result<usize, CacheError>> + Send + 'a>>
Delete every entry carrying
tag; returns the number removed.fn clear( &self, ) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + '_>>
Auto Trait Implementations§
impl Forget for FileStore
impl Freeze for FileStore
impl Move for FileStore
impl RefUnwindSafe for FileStore
impl Send for FileStore
impl Sync for FileStore
impl Unpin for FileStore
impl UnsafeUnpin for FileStore
impl UnwindSafe for FileStore
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