pub struct MetadataCache { /* private fields */ }Expand description
SQLite-based metadata cache (thread-safe)
Implementations§
Source§impl MetadataCache
impl MetadataCache
Sourcepub fn get(
&self,
path: &Path,
current_mtime: SystemTime,
) -> Result<Option<SessionMetadata>>
pub fn get( &self, path: &Path, current_mtime: SystemTime, ) -> Result<Option<SessionMetadata>>
Get cached metadata if fresh, otherwise None
Sourcepub fn put(
&self,
path: &Path,
meta: &SessionMetadata,
mtime: SystemTime,
) -> Result<()>
pub fn put( &self, path: &Path, meta: &SessionMetadata, mtime: SystemTime, ) -> Result<()>
Store metadata in cache
Sourcepub fn invalidate(&self, path: &Path) -> Result<()>
pub fn invalidate(&self, path: &Path) -> Result<()>
Invalidate cache entry for a path
Sourcepub fn get_project_paths(&self, project: &str) -> Result<Vec<PathBuf>>
pub fn get_project_paths(&self, project: &str) -> Result<Vec<PathBuf>>
Get all cached paths for a project
Sourcepub fn stats(&self) -> Result<CacheStats>
pub fn stats(&self) -> Result<CacheStats>
Get cache statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MetadataCache
impl RefUnwindSafe for MetadataCache
impl Send for MetadataCache
impl Sync for MetadataCache
impl Unpin for MetadataCache
impl UnwindSafe for MetadataCache
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