Trait pcap_file::pcapng::blocks::PcapNgBlock
source · pub trait PcapNgBlock<'a> {
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§
sourcefn from_slice<B: ByteOrder>(slice: &'a [u8]) -> Result<(&[u8], Self), PcapError>where
Self: Sized,
fn from_slice<B: ByteOrder>(slice: &'a [u8]) -> Result<(&[u8], Self), PcapError>where
Self: Sized,
Parse a new block from a slice
sourcefn write_to<B: ByteOrder, W: Write>(&self, writer: &mut W) -> IoResult<usize>
fn write_to<B: ByteOrder, W: Write>(&self, writer: &mut W) -> IoResult<usize>
Write the content of a block into a writer
sourcefn into_block(self) -> Block<'a>
fn into_block(self) -> Block<'a>
Convert a block into the Block
enumeration