pub struct CaptureTracker { /* private fields */ }Expand description
Tracks pending capture requests and correlates responses.
Thread-safe structure that allows concurrent request creation and response delivery.
Uses atomic counters for unique request IDs and RwLock for the pending request map.
Implementations§
Source§impl CaptureTracker
impl CaptureTracker
Sourcepub fn create_pending(&self) -> (u64, Receiver<CaptureResult>)
pub fn create_pending(&self) -> (u64, Receiver<CaptureResult>)
Create a pending capture request.
Returns the request ID and a receiver for the result.
Sourcepub fn deliver_response(&self, request_id: u64, result: CaptureResult) -> bool
pub fn deliver_response(&self, request_id: u64, result: CaptureResult) -> bool
Deliver a capture response.
Returns true if the response was delivered, false if no matching request.
Sourcepub fn cancel(&self, request_id: u64) -> bool
pub fn cancel(&self, request_id: u64) -> bool
Cancel a pending request (e.g., on timeout).
Returns true if the request was found and cancelled.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get the number of pending requests.
Trait Implementations§
Source§impl Debug for CaptureTracker
impl Debug for CaptureTracker
Auto Trait Implementations§
impl !Freeze for CaptureTracker
impl !RefUnwindSafe for CaptureTracker
impl Send for CaptureTracker
impl Sync for CaptureTracker
impl Unpin for CaptureTracker
impl UnsafeUnpin for CaptureTracker
impl !UnwindSafe for CaptureTracker
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request