pub trait BitStreamVisitor {
    // Required methods
    fn should_enter_block(&mut self, id: u64) -> bool;
    fn did_exit_block(&mut self);
    fn visit(&mut self, record: Record);

    // Provided method
    fn validate(&self, _signature: Signature) -> bool { ... }
}
Expand description

A visitor which receives callbacks while reading a bitstream.

Required Methods§

source

fn should_enter_block(&mut self, id: u64) -> bool

Called when a new block is encountered. Return true to enter the block and read its contents, or false to skip it.

source

fn did_exit_block(&mut self)

Called when a block is exited.

source

fn visit(&mut self, record: Record)

Called whenever a record is encountered.

Provided Methods§

source

fn validate(&self, _signature: Signature) -> bool

Validate a bitstream’s signature or “magic number”.

Implementors§