pub struct Capture<T> { /* private fields */ }Expand description
Capture TCP packets on an interface
Implementations§
Source§impl Capture<Ready>
impl Capture<Ready>
Source§impl Capture<Capturing>
impl Capture<Capturing>
Sourcepub fn end(self) -> Result<Vec<IpPacket>, CaptureError>
pub fn end(self) -> Result<Vec<IpPacket>, CaptureError>
Stop capturing packets and get captured packets
This will signal each thread to stop and get the captured packets.
§Errors
If there is an error in joining the thread that stores the packets, an error will be returned. No error in joining the snooping thread will be returned as long as the store thread returns properly.
Auto Trait Implementations§
impl<T> Freeze for Capture<T>where
T: Freeze,
impl<T> RefUnwindSafe for Capture<T>where
T: RefUnwindSafe,
impl<T> Send for Capture<T>where
T: Send,
impl<T> Sync for Capture<T>where
T: Sync,
impl<T> Unpin for Capture<T>where
T: Unpin,
impl<T> UnwindSafe for Capture<T>where
T: UnwindSafe,
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