pub struct AnalysisCache { /* private fields */ }Expand description
Incremental analysis cache.
Key = file path (relative), value = (content_hash, findings).
The entire cache is invalidated when env_hash changes
(config edits, plugin additions/removals).
Implementations§
Source§impl AnalysisCache
impl AnalysisCache
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 get(&self, rel_path: &str, content_hash: u64) -> Option<&[Finding]>
pub fn get(&self, rel_path: &str, content_hash: u64) -> Option<&[Finding]>
Look up cached findings for a file. Returns Some if content hash matches.
Sourcepub fn put(
&mut self,
rel_path: String,
content_hash: u64,
findings: Vec<Finding>,
)
pub fn put( &mut self, rel_path: String, content_hash: u64, findings: Vec<Finding>, )
Store findings for a file.
Sourcepub fn hash_content(content: &str) -> u64
pub fn hash_content(content: &str) -> u64
Compute a content hash using the same fast hasher.
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> 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,
Query the “status” flags for the
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,
Set the “status” flags for the
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>
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