pub struct DependencyCache { /* private fields */ }Expand description
In-memory dependency cache for O(1) lookups. Caches both forward (file -> dependencies) and reverse (file -> dependents) mappings. Used by daemon for fast invalidation during file watching.
Implementations§
Source§impl DependencyCache
impl DependencyCache
Sourcepub fn is_populated(&self) -> bool
pub fn is_populated(&self) -> bool
Check if cache is populated.
Sourcepub fn get_dependencies(&self, file: &str) -> Option<&Vec<String>>
pub fn get_dependencies(&self, file: &str) -> Option<&Vec<String>>
Get files that a file depends on (O(1) lookup).
Sourcepub fn get_dependents(&self, file: &str) -> Option<&Vec<String>>
pub fn get_dependents(&self, file: &str) -> Option<&Vec<String>>
Get files that depend on a file (O(1) lookup).
Sourcepub fn populate(&mut self, dependencies: &[FileDependency])
pub fn populate(&mut self, dependencies: &[FileDependency])
Populate cache from a list of dependencies.
Sourcepub fn invalidate_file(&mut self, file: &str)
pub fn invalidate_file(&mut self, file: &str)
Invalidate cache entries for a specific file (when it changes).
Trait Implementations§
Source§impl Debug for DependencyCache
impl Debug for DependencyCache
Source§impl Default for DependencyCache
impl Default for DependencyCache
Source§fn default() -> DependencyCache
fn default() -> DependencyCache
Returns the “default value” for a type. Read more