pub trait ScanCDP {
    // Required methods
    fn load_rdh_cru<T: RDH>(&mut self) -> Result<T, Error>;
    fn load_payload_raw(
        &mut self,
        payload_size: usize
    ) -> Result<Vec<u8>, Error>;
    fn load_next_rdh_to_filter<T: RDH>(
        &mut self,
        offset_to_next: u16,
        target: FilterTarget
    ) -> Result<T, Error>;
    fn current_mem_pos(&self) -> u64;

    // Provided method
    fn load_cdp<T: RDH>(&mut self) -> Result<(T, Vec<u8>, u64), Error> { ... }
}
Expand description

Trait for a scanner that reads CDPs from a file or stdin

Required Methods§

source

fn load_rdh_cru<T: RDH>(&mut self) -> Result<T, Error>

Loads the next RDH from the input and returns it

source

fn load_payload_raw(&mut self, payload_size: usize) -> Result<Vec<u8>, Error>

Loads the payload in the form of raw bytes from the input and returns it

The size of the payload is given as an argument.

source

fn load_next_rdh_to_filter<T: RDH>( &mut self, offset_to_next: u16, target: FilterTarget ) -> Result<T, Error>

Loads the next RDH that matches the user specified filter target from the input and returns it

source

fn current_mem_pos(&self) -> u64

Convenience function to return the current memory position in the input stream

Provided Methods§

source

fn load_cdp<T: RDH>(&mut self) -> Result<(T, Vec<u8>, u64), Error>

Loads the next CDP (RDH and payload) from the input and returns it as a (RDH, Vec<u8>, u64) tuple.

Object Safety§

This trait is not object safe.

Implementors§