Struct lance_core::cache::FileMetadataCache  
source · pub struct FileMetadataCache { /* private fields */ }Expand description
Cache for various metadata about files.
The cache is keyed by the file path and the type of metadata.
Implementations§
source§impl FileMetadataCache
 
impl FileMetadataCache
pub fn new(capacity: usize) -> Self
pub fn get<T: Send + Sync + 'static>(&self, path: &Path) -> Option<Arc<T>>
pub fn insert<T: DeepSizeOf + Send + Sync + 'static>( &self, path: Path, metadata: Arc<T>, )
sourcepub async fn get_or_insert<T: DeepSizeOf + Send + Sync + 'static, F, Fut>(
    &self,
    path: &Path,
    loader: F,
) -> Result<Arc<T>>
 
pub async fn get_or_insert<T: DeepSizeOf + Send + Sync + 'static, F, Fut>( &self, path: &Path, loader: F, ) -> Result<Arc<T>>
Get an item
If it exists in the cache return that
If it doesn’t then run loader to load the item, insert into cache, and return
Trait Implementations§
source§impl Clone for FileMetadataCache
 
impl Clone for FileMetadataCache
source§fn clone(&self) -> FileMetadataCache
 
fn clone(&self) -> FileMetadataCache
Returns a copy 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 moresource§impl Debug for FileMetadataCache
 
impl Debug for FileMetadataCache
source§impl DeepSizeOf for FileMetadataCache
 
impl DeepSizeOf for FileMetadataCache
source§fn deep_size_of_children(&self, _: &mut Context) -> usize
 
fn deep_size_of_children(&self, _: &mut Context) -> usize
Returns an estimation of the heap-managed storage of this object.
This does not include the size of the object itself. Read more
source§fn deep_size_of(&self) -> usize
 
fn deep_size_of(&self) -> usize
Returns an estimation of a total size of memory owned by the
object, including heap-managed storage. Read more
Auto Trait Implementations§
impl Freeze for FileMetadataCache
impl !RefUnwindSafe for FileMetadataCache
impl Send for FileMetadataCache
impl Sync for FileMetadataCache
impl Unpin for FileMetadataCache
impl !UnwindSafe for FileMetadataCache
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