pub enum Block<'a> {
SectionHeader(SectionHeaderBlock<'a>),
InterfaceDescription(InterfaceDescriptionBlock<'a>),
Packet(PacketBlock<'a>),
SimplePacket(SimplePacketBlock<'a>),
NameResolution(NameResolutionBlock<'a>),
InterfaceStatistics(InterfaceStatisticsBlock<'a>),
EnhancedPacket(EnhancedPacketBlock<'a>),
SystemdJournalExport(SystemdJournalExportBlock<'a>),
Unknown(UnknownBlock<'a>),
}
Expand description
PcapNg parsed blocks
Variants§
SectionHeader(SectionHeaderBlock<'a>)
Section Header block
InterfaceDescription(InterfaceDescriptionBlock<'a>)
Interface Description block
Packet(PacketBlock<'a>)
Packet block
SimplePacket(SimplePacketBlock<'a>)
Simple packet block
NameResolution(NameResolutionBlock<'a>)
Name Resolution block
InterfaceStatistics(InterfaceStatisticsBlock<'a>)
Interface statistics block
EnhancedPacket(EnhancedPacketBlock<'a>)
Enhanced packet block
SystemdJournalExport(SystemdJournalExportBlock<'a>)
Systemd Journal Export block
Unknown(UnknownBlock<'a>)
Unknown block
Implementations§
Source§impl<'a> Block<'a>
impl<'a> Block<'a>
Sourcepub fn into_owned(self) -> Block<'static>
pub fn into_owned(self) -> Block<'static>
Returns a version of self
with all fields converted to owning versions.
Source§impl<'a> Block<'a>
impl<'a> Block<'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 Block
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 Block
to a writer.
Sourcepub fn try_from_raw_block<B: ByteOrder>(
raw_block: RawBlock<'a>,
) -> Result<Block<'a>, PcapError>
pub fn try_from_raw_block<B: ByteOrder>( raw_block: RawBlock<'a>, ) -> Result<Block<'a>, PcapError>
Sourcepub fn into_enhanced_packet(self) -> Option<EnhancedPacketBlock<'a>>
pub fn into_enhanced_packet(self) -> Option<EnhancedPacketBlock<'a>>
Tries to downcasts the current block into an EnhancedPacketBlock
Sourcepub fn into_interface_description(self) -> Option<InterfaceDescriptionBlock<'a>>
pub fn into_interface_description(self) -> Option<InterfaceDescriptionBlock<'a>>
Tries to downcasts the current block into an InterfaceDescriptionBlock
Sourcepub fn into_interface_statistics(self) -> Option<InterfaceStatisticsBlock<'a>>
pub fn into_interface_statistics(self) -> Option<InterfaceStatisticsBlock<'a>>
Tries to downcasts the current block into an InterfaceStatisticsBlock
Sourcepub fn into_name_resolution(self) -> Option<NameResolutionBlock<'a>>
pub fn into_name_resolution(self) -> Option<NameResolutionBlock<'a>>
Tries to downcast the current block into an NameResolutionBlock
, if possible
Sourcepub fn into_packet(self) -> Option<PacketBlock<'a>>
pub fn into_packet(self) -> Option<PacketBlock<'a>>
Tries to downcast the current block into an PacketBlock
, if possible
Sourcepub fn into_section_header(self) -> Option<SectionHeaderBlock<'a>>
pub fn into_section_header(self) -> Option<SectionHeaderBlock<'a>>
Tries to downcast the current block into an SectionHeaderBlock
, if possible
Sourcepub fn into_simple_packet(self) -> Option<SimplePacketBlock<'a>>
pub fn into_simple_packet(self) -> Option<SimplePacketBlock<'a>>
Tries to downcast the current block into an SimplePacketBlock
, if possible
Sourcepub fn into_systemd_journal_export(
self,
) -> Option<SystemdJournalExportBlock<'a>>
pub fn into_systemd_journal_export( self, ) -> Option<SystemdJournalExportBlock<'a>>
Tries to downcast the current block into an SystemdJournalExportBlock
, if possible