pub struct ConnectionSlots {
signal: CondWait,
slots: AtomicUsize,
max_slots: usize,
}
Expand description
Manages available inbound and outbound slots.
Fields§
§signal: CondWait
A condvar for notifying when a slot become available.
slots: AtomicUsize
The number of occupied slots
max_slots: usize
The maximum number of slots.
Implementations§
Source§impl ConnectionSlots
impl ConnectionSlots
Sourcepub async fn remove(&self)
pub async fn remove(&self)
Decreases the occupied slots by one and notifies the waiting signal to start accepting/connecting new connections.
Sourcepub async fn wait_for_slot(&self)
pub async fn wait_for_slot(&self)
Waits for a slot to become available.
Auto Trait Implementations§
impl !Freeze for ConnectionSlots
impl !RefUnwindSafe for ConnectionSlots
impl Send for ConnectionSlots
impl Sync for ConnectionSlots
impl Unpin for ConnectionSlots
impl UnwindSafe for ConnectionSlots
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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