pub struct CompiledRules { /* private fields */ }Implementations§
Source§impl CompiledRules
impl CompiledRules
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Number of compiled rules.
Sourcepub fn rule_names(&self) -> impl Iterator<Item = &str>
pub fn rule_names(&self) -> impl Iterator<Item = &str>
Iterate over the names of every compiled rule in source order.
Source§impl CompiledRules
impl CompiledRules
Sourcepub fn scan(&self, text: &str) -> Vec<Match>
pub fn scan(&self, text: &str) -> Vec<Match>
Match text against all text-based rules. PHash rules are skipped (require a file path).
Sourcepub fn scan_file(&self, path: &Path) -> Vec<Match>
pub fn scan_file(&self, path: &Path) -> Vec<Match>
Match a file against rules that contain phash patterns.
BUG-008: reads file content as text so string patterns also match in rules that combine phash + string conditions.
pub fn register_cleaner( &mut self, name: impl Into<String>, cleaner: Box<dyn TextCleaner>, )
pub fn register_chunker( &mut self, name: impl Into<String>, chunker: Box<dyn Chunker>, )
Auto Trait Implementations§
impl Freeze for CompiledRules
impl !RefUnwindSafe for CompiledRules
impl Send for CompiledRules
impl Sync for CompiledRules
impl Unpin for CompiledRules
impl UnsafeUnpin for CompiledRules
impl !UnwindSafe for CompiledRules
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