pub struct FilesystemSource { /* private fields */ }Expand description
Scans files in a directory tree.
Implementations§
Source§impl FilesystemSource
impl FilesystemSource
Sourcepub fn with_window_config(self, window_size: usize, overlap: usize) -> Self
pub fn with_window_config(self, window_size: usize, overlap: usize) -> Self
Override the windowed-scan parameters. Production callers stick
with the defaults (64 MiB / 4 KiB); tests use this to exercise
the multi-window path on tiny fixtures. window_size must
strictly exceed overlap (the underlying slicer asserts this).
Sourcepub fn with_merkle_skip(self, merkle: Arc<MerkleIndex>) -> Self
pub fn with_merkle_skip(self, merkle: Arc<MerkleIndex>) -> Self
Wire the source up to a merkle index so (path, mtime, size)
matches skip the file before it is read. The cache contents
themselves are loaded by the orchestrator (which also handles
detector-spec-hash invalidation) and shared via Arc so multiple
sources can consult one index.
Sourcepub fn skipped_counter(&self) -> Arc<AtomicUsize>
pub fn skipped_counter(&self) -> Arc<AtomicUsize>
Returns a counter that the source increments every time the
metadata fast-path skips a file. Cloned Arc<AtomicUsize>, safe
to read after the iterator drains.
Sourcepub fn with_include_paths(self, paths: Vec<PathBuf>) -> Self
pub fn with_include_paths(self, paths: Vec<PathBuf>) -> Self
Only include files whose paths match one of the given paths. Paths are compared against the absolute path of each discovered file.
Sourcepub fn with_max_file_size(self, bytes: u64) -> Self
pub fn with_max_file_size(self, bytes: u64) -> Self
Override the maximum file size scanned from disk.
Sourcepub fn with_ignore_paths(self, paths: Vec<String>) -> Self
pub fn with_ignore_paths(self, paths: Vec<String>) -> Self
Add patterns to ignore during the walk.
Sourcepub fn with_respect_gitignore(self, respect: bool) -> Self
pub fn with_respect_gitignore(self, respect: bool) -> Self
Override whether the walk honors .gitignore / .keyhogignore.
keyhog scan-system flips this to false so a leaked key
stashed in .gitignore can’t hide.
Trait Implementations§
Source§impl Source for FilesystemSource
impl Source for FilesystemSource
Auto Trait Implementations§
impl Freeze for FilesystemSource
impl !RefUnwindSafe for FilesystemSource
impl Send for FilesystemSource
impl Sync for FilesystemSource
impl Unpin for FilesystemSource
impl UnsafeUnpin for FilesystemSource
impl !UnwindSafe for FilesystemSource
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> 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