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.
Sourcepub fn try_into_block<B: ByteOrder>(self) -> PcapResult<Block<'a>>
pub fn try_into_block<B: ByteOrder>(self) -> PcapResult<Block<'a>>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for RawBlock<'a>
impl<'a> RefUnwindSafe for RawBlock<'a>
impl<'a> Send for RawBlock<'a>
impl<'a> Sync for RawBlock<'a>
impl<'a> Unpin for RawBlock<'a>
impl<'a> UnwindSafe for RawBlock<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more