pub struct CacheMetadataManager { /* private fields */ }Implementations§
Source§impl CacheMetadataManager
impl CacheMetadataManager
pub fn new(metadata_file_path: String) -> Self
Sourcepub fn store_metadata(
&mut self,
key: &str,
metadata: CacheMetadata,
) -> Result<(), String>
pub fn store_metadata( &mut self, key: &str, metadata: CacheMetadata, ) -> Result<(), String>
Store metadata for a cache entry
Sourcepub fn get_metadata(&self, key: &str) -> Option<&CacheMetadata>
pub fn get_metadata(&self, key: &str) -> Option<&CacheMetadata>
Retrieve metadata for a cache key
Sourcepub fn update_access_time(&mut self, key: &str) -> Result<(), String>
pub fn update_access_time(&mut self, key: &str) -> Result<(), String>
Update the access time for a cache entry
Sourcepub fn is_cache_valid(&self, key: &str) -> bool
pub fn is_cache_valid(&self, key: &str) -> bool
Check if a cache entry exists and is still valid
Sourcepub fn remove_metadata(&mut self, key: &str) -> Result<(), String>
pub fn remove_metadata(&mut self, key: &str) -> Result<(), String>
Remove metadata for a cache key
Sourcepub fn get_all_keys(&self) -> Vec<String>
pub fn get_all_keys(&self) -> Vec<String>
Get all cache keys
Auto Trait Implementations§
impl Freeze for CacheMetadataManager
impl RefUnwindSafe for CacheMetadataManager
impl Send for CacheMetadataManager
impl Sync for CacheMetadataManager
impl Unpin for CacheMetadataManager
impl UnwindSafe for CacheMetadataManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more