pub struct CacheStore { /* private fields */ }Expand description
A file-based cache store for scan findings.
Implementations§
Source§impl CacheStore
impl CacheStore
pub fn new(project_root: &Path) -> Self
Sourcepub fn with_dir(dir: PathBuf) -> Self
pub fn with_dir(dir: PathBuf) -> Self
Create a cache store that writes directly to the given directory
instead of appending .slopguard-cache.
pub fn dir(&self) -> &Path
Sourcepub fn check_rules_changed(
&self,
current_hash: &str,
) -> Result<bool, CacheError>
pub fn check_rules_changed( &self, current_hash: &str, ) -> Result<bool, CacheError>
Check if the rules have changed since the last scan. If they have, invalidate the entire cache.
Sourcepub fn get(&self, file_hash: &str) -> Option<Vec<Finding>>
pub fn get(&self, file_hash: &str) -> Option<Vec<Finding>>
Look up cached findings for a file by its content hash.
Auto Trait Implementations§
impl Freeze for CacheStore
impl RefUnwindSafe for CacheStore
impl Send for CacheStore
impl Sync for CacheStore
impl Unpin for CacheStore
impl UnsafeUnpin for CacheStore
impl UnwindSafe for CacheStore
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> 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