pub struct MmapPacketSource { /* private fields */ }Expand description
Memory-mapped packet source.
Maps the entire file into virtual memory, allowing the OS to handle caching and paging. Supports both uncompressed and compressed files.
Implementations§
Source§impl MmapPacketSource
impl MmapPacketSource
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Open a PCAP or PCAPNG file with memory mapping.
Automatically detects and handles compression.
Sourcepub fn compression(&self) -> Compression
pub fn compression(&self) -> Compression
Get the detected compression format.
Sourcepub fn pcap_format(&self) -> PcapFormat
pub fn pcap_format(&self) -> PcapFormat
Get the PCAP format.
Sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Check if this file is compressed.
Trait Implementations§
Source§impl Clone for MmapPacketSource
impl Clone for MmapPacketSource
Source§fn clone(&self) -> MmapPacketSource
fn clone(&self) -> MmapPacketSource
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 MmapPacketSource
impl Debug for MmapPacketSource
Source§impl PacketSource for MmapPacketSource
impl PacketSource for MmapPacketSource
Source§type Reader = MmapPacketReader
type Reader = MmapPacketReader
The reader type this source produces
Source§fn metadata(&self) -> &PacketSourceMetadata
fn metadata(&self) -> &PacketSourceMetadata
Get metadata about this source
Source§fn reader(&self, range: Option<&PacketRange>) -> Result<Self::Reader, Error>
fn reader(&self, range: Option<&PacketRange>) -> Result<Self::Reader, Error>
Create a reader for the given range.
If range is None, reads the entire source.
Source§fn partitions(&self, _max_partitions: usize) -> Result<Vec<PacketRange>, Error>
fn partitions(&self, _max_partitions: usize) -> Result<Vec<PacketRange>, Error>
Compute partition boundaries for parallel reading. Read more
Auto Trait Implementations§
impl Freeze for MmapPacketSource
impl RefUnwindSafe for MmapPacketSource
impl Send for MmapPacketSource
impl Sync for MmapPacketSource
impl Unpin for MmapPacketSource
impl UnwindSafe for MmapPacketSource
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