pcap_file::pcapng::blocks

Trait PcapNgBlock

Source
pub trait PcapNgBlock<'a> {
    // Required methods
    fn from_slice<B: ByteOrder>(
        slice: &'a [u8],
    ) -> Result<(&[u8], Self), PcapError>
       where Self: Sized;
    fn write_to<B: ByteOrder, W: Write>(
        &self,
        writer: &mut W,
    ) -> IoResult<usize>;
    fn into_block(self) -> Block<'a>;
}
Expand description

Common interface for the PcapNg blocks

Required Methods§

Source

fn from_slice<B: ByteOrder>(slice: &'a [u8]) -> Result<(&[u8], Self), PcapError>
where Self: Sized,

Parse a new block from a slice

Source

fn write_to<B: ByteOrder, W: Write>(&self, writer: &mut W) -> IoResult<usize>

Write the content of a block into a writer

Source

fn into_block(self) -> Block<'a>

Convert a block into the Block enumeration

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§