pub struct IncrementalCache {
cache_dir: PathBuf,
}Expand description
Manages the cache directory and provides the core process_file method.
Fields§
§cache_dir: PathBufImplementations§
Source§impl IncrementalCache
impl IncrementalCache
Sourcepub fn new(cache_dir: &Path) -> Result<Self>
pub fn new(cache_dir: &Path) -> Result<Self>
Create a new cache manager.
cache_dir will be created if it does not exist.
Sourcepub fn process_file(
&self,
file_path: &Path,
relative_path: &str,
parse_fn: ParseFn,
) -> Result<FileFacts>
pub fn process_file( &self, file_path: &Path, relative_path: &str, parse_fn: ParseFn, ) -> Result<FileFacts>
Process a single source file.
file_path– absolute path to the source file.relative_path– the path that will be used in the cache name (usually the path relative to the project root).parse_fn– a boxed closure that parses the source and returns facts; it is called only if the file has changed or is not cached.
Returns FileFacts containing the extracted or cached facts.
fn cache_paths(&self, relative_path: &str) -> (PathBuf, PathBuf)
Auto Trait Implementations§
impl Freeze for IncrementalCache
impl RefUnwindSafe for IncrementalCache
impl Send for IncrementalCache
impl Sync for IncrementalCache
impl Unpin for IncrementalCache
impl UnsafeUnpin 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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