pub struct StreamScanner<'ss> { /* private fields */ }
Implementations§
Source§impl<'ss> StreamScanner<'ss>
impl<'ss> StreamScanner<'ss>
Sourcepub fn close<F>(self, on_match: F) -> Result<Scan, Error>
pub fn close<F>(self, on_match: F) -> Result<Scan, Error>
Close the given Stream
object using hs_close_stream
.
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§
Auto Trait Implementations§
impl<'ss> Freeze for StreamScanner<'ss>
impl<'ss> RefUnwindSafe for StreamScanner<'ss>
impl<'ss> !Send for StreamScanner<'ss>
impl<'ss> !Sync for StreamScanner<'ss>
impl<'ss> Unpin for StreamScanner<'ss>
impl<'ss> UnwindSafe for StreamScanner<'ss>
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