pub struct IncrementalCache {
pub files: HashMap<PathBuf, FileCacheEntry>,
pub metadata: CacheMetadata,
}Fields§
§files: HashMap<PathBuf, FileCacheEntry>Maps absolute file paths to their cache entries
metadata: CacheMetadataMetadata about the cache itself
Implementations§
Source§impl IncrementalCache
impl IncrementalCache
Sourcepub fn load_from(path: &Path) -> SearchResult<Self>
pub fn load_from(path: &Path) -> SearchResult<Self>
Loads a cache from disk
Sourcepub fn save_to(&self, path: &Path) -> SearchResult<()>
pub fn save_to(&self, path: &Path) -> SearchResult<()>
Saves the cache to disk
Sourcepub fn update_stats(&mut self, hits: usize, total: usize)
pub fn update_stats(&mut self, hits: usize, total: usize)
Updates cache statistics after a search operation
Trait Implementations§
Source§impl Debug for IncrementalCache
impl Debug for IncrementalCache
Source§impl Default for IncrementalCache
impl Default for IncrementalCache
Source§fn default() -> IncrementalCache
fn default() -> IncrementalCache
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for IncrementalCache
impl<'de> Deserialize<'de> for IncrementalCache
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IncrementalCache
impl RefUnwindSafe for IncrementalCache
impl Send for IncrementalCache
impl Sync for IncrementalCache
impl Unpin for IncrementalCache
impl UnwindSafe for IncrementalCache
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