pub struct GenericBlock {
pub block_id: u32,
pub block_length: u32,
pub data: Option<Vec<u8>>,
}Expand description
A Generic Block in the PCAP-NG format
Used for unknown block ids or custom blocks that do not have a specific structure defined in the PCAP-NG specification.
Fields§
§block_id: u32The block ID
block_length: u32The length of the block in bytes, including the header
data: Option<Vec<u8>>The data of the block, if any
Implementations§
Source§impl GenericBlock
impl GenericBlock
pub fn new(block_id: u32, data: Option<Vec<u8>>) -> Self
pub fn read_with_header<R: Read>( reader: &mut R, header: &BlockHeader, byte_order: Endianness, ) -> Result<Self, PcapNgParseError>
pub fn read<R: Read>( reader: &mut R, byte_order: Endianness, ) -> Result<Self, PcapNgParseError>
Trait Implementations§
Source§impl Clone for GenericBlock
impl Clone for GenericBlock
Source§fn clone(&self) -> GenericBlock
fn clone(&self) -> GenericBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenericBlock
impl Debug for GenericBlock
Source§impl PartialEq for GenericBlock
impl PartialEq for GenericBlock
impl Eq for GenericBlock
impl StructuralPartialEq for GenericBlock
Auto Trait Implementations§
impl Freeze for GenericBlock
impl RefUnwindSafe for GenericBlock
impl Send for GenericBlock
impl Sync for GenericBlock
impl Unpin for GenericBlock
impl UnwindSafe for GenericBlock
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