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