pub struct AsyncCaptureHandle { /* private fields */ }Expand description
Handle to control the asynchronous capture.
AsyncCaptureHandle allows stopping the capture from another
thread or async task.
Implementations§
Source§impl AsyncCaptureHandle
impl AsyncCaptureHandle
Sourcepub fn stop(&self)
pub fn stop(&self)
Stops the capture from another thread or asynchronous task.
This method sets the internal stop flag, signaling the background
capture thread to terminate gracefully. It also sends a Stop
message through the internal channel to ensure that any awaiting
calls to AsyncCapture::next_packet() will return None.
§Notes
- Calling this method multiple times is safe and idempotent.
- Once stopped, the background thread will no longer produce packets.
- After calling
stop, any future calls toAsyncCapture::next_packet()will immediately returnNone.
Trait Implementations§
Source§impl Clone for AsyncCaptureHandle
impl Clone for AsyncCaptureHandle
Source§fn clone(&self) -> AsyncCaptureHandle
fn clone(&self) -> AsyncCaptureHandle
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 moreAuto Trait Implementations§
impl Freeze for AsyncCaptureHandle
impl RefUnwindSafe for AsyncCaptureHandle
impl Send for AsyncCaptureHandle
impl Sync for AsyncCaptureHandle
impl Unpin for AsyncCaptureHandle
impl UnwindSafe for AsyncCaptureHandle
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