pub struct PacketRef<'a> {
pub frame_number: u64,
pub timestamp_us: i64,
pub captured_len: u32,
pub original_len: u32,
pub link_type: u16,
pub data: &'a [u8],
}Expand description
Borrowed packet reference - zero-copy view into pcap_parser buffer.
This struct is passed to callbacks in process_packets(). The data
is only valid for the duration of the callback - it must be processed
(parsed, copied to Arrow buffers, etc.) before the callback returns.
Fields§
§frame_number: u64Frame number (1-indexed, matching Wireshark)
timestamp_us: i64Timestamp in microseconds since Unix epoch
captured_len: u32Captured length (may be less than original)
original_len: u32Original packet length on the wire
link_type: u16Link layer type (e.g., 1 = Ethernet)
data: &'a [u8]Packet data (borrowed from pcap_parser buffer)
Implementations§
Trait Implementations§
impl<'a> Copy for PacketRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for PacketRef<'a>
impl<'a> RefUnwindSafe for PacketRef<'a>
impl<'a> Send for PacketRef<'a>
impl<'a> Sync for PacketRef<'a>
impl<'a> Unpin for PacketRef<'a>
impl<'a> UnwindSafe for PacketRef<'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