Skip to main content

PcapNgBlock

Trait PcapNgBlock 

Source
pub trait PcapNgBlock<'a>: Sized {
    const BLOCK_TYPE: BlockType;

    // Required method
    fn parse(body: &'a [u8]) -> IResult<&'a [u8], Self, ParsingError<'a>>;
}
Expand description

A trait for types that represent a pcapng block.

Required Associated Constants§

Source

const BLOCK_TYPE: BlockType

The type of block.

Required Methods§

Source

fn parse(body: &'a [u8]) -> IResult<&'a [u8], Self, ParsingError<'a>>

Parses the block body excluding the block type and block total length header and the repeated block total length footer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> PcapNgBlock<'a> for ParsedEnhancedPacket<'a>

Source§

const BLOCK_TYPE: BlockType = BlockType::EnhancedPacket

Source§

impl<'a> PcapNgBlock<'a> for ParsedInterfaceDescription<'a>

Source§

const BLOCK_TYPE: BlockType = BlockType::InterfaceDescription

Source§

impl<'a> PcapNgBlock<'a> for ParsedSectionHeader

Source§

const BLOCK_TYPE: BlockType = BlockType::SectionHeader