pub struct ProjectCache { /* private fields */ }Expand description
Unified project cache: parse results + findings + symbol summaries. Facade over three cache layers (models, symbols, findings) plus the meta bookkeeping they share. Method count ≥ 10 is structural, not a smell — each layer exposes get/put atop the layered read/write helpers.
Implementations§
Source§impl ProjectCache
impl ProjectCache
Sourcepub fn open(project_root: &Path, env_hash: u64) -> Self
pub fn open(project_root: &Path, env_hash: u64) -> Self
Open or create a cache for the given project root.
Sourcepub fn check_file(&self, rel_path: &str, path: &Path) -> FileStatus
pub fn check_file(&self, rel_path: &str, path: &Path) -> FileStatus
Check if a file is unchanged (mtime + size match). Returns (is_unchanged, content_hash) — hash is 0 if unchanged and not yet computed.
Sourcepub fn get_model(&mut self, chash: u64) -> Option<SourceModel>
pub fn get_model(&mut self, chash: u64) -> Option<SourceModel>
Get cached SourceModel: L1 memory → L2 disk.
Sourcepub fn put_model(&mut self, chash: u64, model: &SourceModel)
pub fn put_model(&mut self, chash: u64, model: &SourceModel)
Store a SourceModel in L1 + L2.
Sourcepub fn get_symbols(&mut self, chash: u64) -> Option<SymbolIndex>
pub fn get_symbols(&mut self, chash: u64) -> Option<SymbolIndex>
Get a cached SymbolIndex: L1 memory → L2 disk.
Fast path for cha deps, LSP workspace-symbols and any other
consumer that only needs structural information (names, relations,
positions) without per-function-body analyse data.
Sourcepub fn put_symbols(&mut self, chash: u64, idx: &SymbolIndex)
pub fn put_symbols(&mut self, chash: u64, idx: &SymbolIndex)
Store a SymbolIndex in L1 + L2. Called alongside put_model so
both caches stay in lockstep.
Sourcepub fn put_findings(&mut self, chash: u64, findings: &[Finding])
pub fn put_findings(&mut self, chash: u64, findings: &[Finding])
Store findings for a file.
Sourcepub fn update_file_entry(
&mut self,
rel_path: String,
path: &Path,
chash: u64,
imports: Vec<String>,
)
pub fn update_file_entry( &mut self, rel_path: String, path: &Path, chash: u64, imports: Vec<String>, )
Update file metadata after processing.
Sourcepub fn get_imports(&self, rel_path: &str) -> Option<&[String]>
pub fn get_imports(&self, rel_path: &str) -> Option<&[String]>
Get cached imports for a file (from meta, no disk I/O).
Auto Trait Implementations§
impl Freeze for ProjectCache
impl RefUnwindSafe for ProjectCache
impl Send for ProjectCache
impl Sync for ProjectCache
impl Unpin for ProjectCache
impl UnsafeUnpin for ProjectCache
impl UnwindSafe for ProjectCache
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§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>
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>
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