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