pub struct QueueDepthTracker { /* private fields */ }Expand description
Request queue depth tracker.
Thread-safe counter for tracking how many requests are currently queued or in-flight. Used to implement backpressure.
Implementations§
Source§impl QueueDepthTracker
impl QueueDepthTracker
Sourcepub fn try_acquire(&self) -> bool
pub fn try_acquire(&self) -> bool
Try to acquire a slot. Returns true if successful, false if queue is full.
Sourcepub fn has_capacity(&self) -> bool
pub fn has_capacity(&self) -> bool
Whether the queue has capacity for more requests.
Auto Trait Implementations§
impl !Freeze for QueueDepthTracker
impl RefUnwindSafe for QueueDepthTracker
impl Send for QueueDepthTracker
impl Sync for QueueDepthTracker
impl Unpin for QueueDepthTracker
impl UnsafeUnpin for QueueDepthTracker
impl UnwindSafe for QueueDepthTracker
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more