Trait BitStreamVisitor

Source
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§