pub struct ScanConfig {
pub chunk_size: usize,
pub overlap_size: usize,
}Expand description
Configuration for the streaming scanner.
§Tuning Guide
| Workload | chunk_size | overlap_size |
|---|---|---|
| Small files (< 10 MB) | 256 KiB | 1 KiB |
| General purpose | 1 MiB | 4 KiB |
| Large files (> 1 GB) | 4–8 MiB | 8 KiB |
| Memory-constrained | 64 KiB | 1 KiB |
overlap_size should be ≥ the longest expected match. Most secret
patterns (API keys, emails, SSNs) are well under 256 bytes, so the
4 KiB default provides ample margin.
Fields§
§chunk_size: usizeSize of each chunk read from the input (bytes).
Larger chunks improve throughput (fewer syscalls) but use more memory. Default: 1 MiB.
overlap_size: usizeOverlap between consecutive chunks (bytes).
Must be ≥ the maximum expected match length. Patterns whose matches can exceed this length risk being missed at chunk boundaries. Default: 4 KiB.
Implementations§
Trait Implementations§
Source§impl Clone for ScanConfig
impl Clone for ScanConfig
Source§fn clone(&self) -> ScanConfig
fn clone(&self) -> ScanConfig
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 ScanConfig
impl Debug for ScanConfig
Auto Trait Implementations§
impl Freeze for ScanConfig
impl RefUnwindSafe for ScanConfig
impl Send for ScanConfig
impl Sync for ScanConfig
impl Unpin for ScanConfig
impl UnsafeUnpin for ScanConfig
impl UnwindSafe for ScanConfig
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