pub struct RawBlock<'a> {
pub type_: u32,
pub initial_len: u32,
pub body: Cow<'a, [u8]>,
pub trailer_len: u32,
}
Expand description
PcapNg Block
Fields§
§type_: u32
Type field
initial_len: u32
Initial length field
body: Cow<'a, [u8]>
Body of the block
trailer_len: u32
Trailer length field
Implementations§
source§impl<'a> RawBlock<'a>
impl<'a> RawBlock<'a>
sourcepub fn from_slice<B: ByteOrder>(
slice: &'a [u8]
) -> Result<(&'a [u8], Self), PcapError>
pub fn from_slice<B: ByteOrder>(
slice: &'a [u8]
) -> Result<(&'a [u8], Self), PcapError>
Parses a borrowed RawBlock
from a slice.
sourcepub fn write_to<B: ByteOrder, W: Write>(&self, writer: &mut W) -> IoResult<usize>
pub fn write_to<B: ByteOrder, W: Write>(&self, writer: &mut W) -> IoResult<usize>
Writes a RawBlock
to a writer.
Uses the endianness of the header.