pub struct PacketReader { /* private fields */ }Expand description
Simple packet reader that handles timeouts gracefully
Implementations§
Source§impl PacketReader
impl PacketReader
pub fn new(capture: Capture<Active>) -> Self
Sourcepub fn next_packet(&mut self) -> Result<Option<CapturedPacket>>
pub fn next_packet(&mut self) -> Result<Option<CapturedPacket>>
Read next packet, returning None on timeout.
Sourcepub fn stats(&mut self) -> Result<CaptureStats>
pub fn stats(&mut self) -> Result<CaptureStats>
Get capture statistics
Auto Trait Implementations§
impl !Sync for PacketReader
impl Freeze for PacketReader
impl RefUnwindSafe for PacketReader
impl Send for PacketReader
impl Unpin for PacketReader
impl UnsafeUnpin for PacketReader
impl UnwindSafe for PacketReader
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