pub trait Format: Send {
// Required methods
fn name(&self) -> &'static str;
fn chunks<'a>(&'a self) -> Box<dyn Iterator<Item = Chunk<'a>> + 'a>;
fn apply(&mut self, hits: &[Hit]) -> Result<()>;
fn to_bytes(&self) -> Result<Vec<u8>>;
}Expand description
A handler for one specific capture-file format.
The trait is intentionally dyn-compatible: no Self: Sized methods, no
associated constants. Construction is done via free fn pointers on a
Handler so the Dispatcher can route based on file head bytes.
Required Methods§
Sourcefn chunks<'a>(&'a self) -> Box<dyn Iterator<Item = Chunk<'a>> + 'a>
fn chunks<'a>(&'a self) -> Box<dyn Iterator<Item = Chunk<'a>> + 'a>
Iterate scannable chunks for the detection engine.