pub struct AnalysisCache {
pub files: HashMap<String, CachedFileResult>,
}Expand description
Analysis cache stored in .boundary/cache.json.
Fields§
§files: HashMap<String, CachedFileResult>Implementations§
Source§impl AnalysisCache
impl AnalysisCache
pub fn new() -> Self
Sourcepub fn load(project_root: &Path) -> Result<Self>
pub fn load(project_root: &Path) -> Result<Self>
Load cache from .boundary/cache.json relative to project root.
Sourcepub fn save(&self, project_root: &Path) -> Result<()>
pub fn save(&self, project_root: &Path) -> Result<()>
Save cache to .boundary/cache.json relative to project root.
Sourcepub fn is_stale(&self, rel_path: &str, content: &str) -> bool
pub fn is_stale(&self, rel_path: &str, content: &str) -> bool
Check if a file’s cached result is stale (content changed).
Sourcepub fn get(&self, rel_path: &str, content: &str) -> Option<&CachedFileResult>
pub fn get(&self, rel_path: &str, content: &str) -> Option<&CachedFileResult>
Get cached result for a file if it exists and is current.
Sourcepub fn insert(
&mut self,
rel_path: String,
content: &str,
result: CachedFileResult,
)
pub fn insert( &mut self, rel_path: String, content: &str, result: CachedFileResult, )
Insert or update a file’s cache entry.
Trait Implementations§
Source§impl Clone for AnalysisCache
impl Clone for AnalysisCache
Source§fn clone(&self) -> AnalysisCache
fn clone(&self) -> AnalysisCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnalysisCache
impl Debug for AnalysisCache
Source§impl Default for AnalysisCache
impl Default for AnalysisCache
Source§fn default() -> AnalysisCache
fn default() -> AnalysisCache
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AnalysisCache
impl<'de> Deserialize<'de> for AnalysisCache
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 AnalysisCache
impl RefUnwindSafe for AnalysisCache
impl Send for AnalysisCache
impl Sync for AnalysisCache
impl Unpin for AnalysisCache
impl UnsafeUnpin for AnalysisCache
impl UnwindSafe for AnalysisCache
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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