pub struct CachedFileMetadata {
pub meta: ObjectMeta,
pub statistics: Arc<Statistics>,
pub ordering: Option<LexOrdering>,
}Expand description
Cached metadata for a file, including statistics and ordering.
This struct embeds the ObjectMeta used for cache validation,
along with the cached statistics and ordering information.
Fields§
§meta: ObjectMetaFile metadata used for cache validation (size, last_modified).
statistics: Arc<Statistics>Cached statistics for the file, if available.
ordering: Option<LexOrdering>Cached ordering for the file.
Implementations§
Source§impl CachedFileMetadata
impl CachedFileMetadata
Sourcepub fn new(
meta: ObjectMeta,
statistics: Arc<Statistics>,
ordering: Option<LexOrdering>,
) -> Self
pub fn new( meta: ObjectMeta, statistics: Arc<Statistics>, ordering: Option<LexOrdering>, ) -> Self
Create a new cached file metadata entry.
Sourcepub fn is_valid_for(&self, current_meta: &ObjectMeta) -> bool
pub fn is_valid_for(&self, current_meta: &ObjectMeta) -> bool
Check if this cached entry is still valid for the given metadata.
Returns true if the file size and last modified time match.
Trait Implementations§
Source§impl CacheAccessor<Path, CachedFileMetadata> for DefaultFileStatisticsCache
impl CacheAccessor<Path, CachedFileMetadata> for DefaultFileStatisticsCache
Source§fn get(&self, key: &Path) -> Option<CachedFileMetadata>
fn get(&self, key: &Path) -> Option<CachedFileMetadata>
Get a cached entry if it exists. Read more
Source§fn put(
&self,
key: &Path,
value: CachedFileMetadata,
) -> Option<CachedFileMetadata>
fn put( &self, key: &Path, value: CachedFileMetadata, ) -> Option<CachedFileMetadata>
Store a value in the cache. Read more
Source§fn remove(&self, k: &Path) -> Option<CachedFileMetadata>
fn remove(&self, k: &Path) -> Option<CachedFileMetadata>
Remove an entry from the cache, returning the value if it existed.
Source§fn contains_key(&self, k: &Path) -> bool
fn contains_key(&self, k: &Path) -> bool
Check if the cache contains a specific key.
Source§impl Clone for CachedFileMetadata
impl Clone for CachedFileMetadata
Source§fn clone(&self) -> CachedFileMetadata
fn clone(&self) -> CachedFileMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CachedFileMetadata
impl !RefUnwindSafe for CachedFileMetadata
impl Send for CachedFileMetadata
impl Sync for CachedFileMetadata
impl Unpin for CachedFileMetadata
impl UnsafeUnpin for CachedFileMetadata
impl !UnwindSafe for CachedFileMetadata
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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