pub struct CompiledScanner {
pub config: ScannerConfig,
pub alphabet_screen: Option<AlphabetScreen>,
/* private fields */
}Expand description
A pre-compiled set of rules for fast execution.
Fields§
§config: ScannerConfig§alphabet_screen: Option<AlphabetScreen>Implementations§
Source§impl CompiledScanner
impl CompiledScanner
pub fn gpu_matcher(&self) -> Option<&AutoMatcher>
Source§impl CompiledScanner
impl CompiledScanner
Sourcepub fn scan_coalesced(&self, chunks: &[Chunk]) -> Vec<Vec<RawMatch>>
pub fn scan_coalesced(&self, chunks: &[Chunk]) -> Vec<Vec<RawMatch>>
High-throughput coalesced scan: all files scanned in parallel, zero overhead for non-hit files.
Architecture: Phase 1: Parallel HS prefilter on raw bytes (no prep, no alloc) Phase 2: Full extraction only on hit files (~5% of total)
Source§impl CompiledScanner
impl CompiledScanner
Sourcepub fn compile(detectors: Vec<DetectorSpec>) -> Result<Self>
pub fn compile(detectors: Vec<DetectorSpec>) -> Result<Self>
Compile all detector specs into a single scanner.
Sourcepub fn with_config(self, config: ScannerConfig) -> Self
pub fn with_config(self, config: ScannerConfig) -> Self
Apply a custom configuration to the compiled scanner.
Sourcepub fn detector_count(&self) -> usize
pub fn detector_count(&self) -> usize
Number of loaded detectors.
Sourcepub fn pattern_count(&self) -> usize
pub fn pattern_count(&self) -> usize
Total number of patterns (AC + fallback).
Sourcepub fn select_backend_for_file(&self, file_size: u64) -> ScanBackend
pub fn select_backend_for_file(&self, file_size: u64) -> ScanBackend
Return the preferred backend for a file of the given size.
Sourcepub fn preferred_backend_label(&self) -> &'static str
pub fn preferred_backend_label(&self) -> &'static str
Return the steady-state backend label used for startup reporting.
Sourcepub fn scan(&self, chunk: &Chunk) -> Vec<RawMatch>
pub fn scan(&self, chunk: &Chunk) -> Vec<RawMatch>
Scan a chunk of text and return all raw credential matches.
Sourcepub fn scan_with_backend(
&self,
chunk: &Chunk,
backend: ScanBackend,
) -> Vec<RawMatch>
pub fn scan_with_backend( &self, chunk: &Chunk, backend: ScanBackend, ) -> Vec<RawMatch>
Scan a chunk using a caller-selected backend.
Sourcepub fn scan_chunks_with_backend(
&self,
chunks: &[Chunk],
backend: ScanBackend,
) -> Vec<Vec<RawMatch>>
pub fn scan_chunks_with_backend( &self, chunks: &[Chunk], backend: ScanBackend, ) -> Vec<Vec<RawMatch>>
Scan multiple chunks using a caller-selected backend.
Sourcepub fn scan_with_deadline(
&self,
chunk: &Chunk,
deadline: Option<Instant>,
) -> Vec<RawMatch>
pub fn scan_with_deadline( &self, chunk: &Chunk, deadline: Option<Instant>, ) -> Vec<RawMatch>
Scan a chunk of text against all compiled detectors.
pub fn scan_with_deadline_and_backend( &self, chunk: &Chunk, deadline: Option<Instant>, backend: Option<ScanBackend>, ) -> Vec<RawMatch>
Auto Trait Implementations§
impl !Freeze for CompiledScanner
impl !RefUnwindSafe for CompiledScanner
impl Send for CompiledScanner
impl Sync for CompiledScanner
impl Unpin for CompiledScanner
impl UnsafeUnpin for CompiledScanner
impl !UnwindSafe for CompiledScanner
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