pub struct BlockScanner<'db> { /* private fields */ }
Expand description
A scanner that supports Vectorscan’s block-based matching APIs
Implementations§
Source§impl<'db> BlockScanner<'db>
impl<'db> BlockScanner<'db>
Sourcepub fn new(db: &'db BlockDatabase) -> Result<Self, Error>
pub fn new(db: &'db BlockDatabase) -> Result<Self, Error>
Create a new scanner with the given database
Sourcepub fn scan<F>(&mut self, data: &[u8], on_match: F) -> Result<Scan, Error>
pub fn scan<F>(&mut self, data: &[u8], on_match: F) -> Result<Scan, Error>
Scan the input using the given callback function
The callback function takes 4 arguments and returns a Scan
value.
The 4 arguments:
- id: u32 The ID of the expression that matched
- from: u64 The offset of the start byte of the match; in practice, always 0
- to: u64 The offset of the byte after the end byte of the match
- flags: u32 Unused; “provided for future use”
For more detail, see the Hyperscan documentation:
Trait Implementations§
Source§impl<'db> Clone for BlockScanner<'db>
impl<'db> Clone for BlockScanner<'db>
Source§fn clone(&self) -> BlockScanner<'db>
fn clone(&self) -> BlockScanner<'db>
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 moreAuto Trait Implementations§
impl<'db> Freeze for BlockScanner<'db>
impl<'db> RefUnwindSafe for BlockScanner<'db>
impl<'db> Send for BlockScanner<'db>
impl<'db> Sync for BlockScanner<'db>
impl<'db> Unpin for BlockScanner<'db>
impl<'db> UnwindSafe for BlockScanner<'db>
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