pub struct ConnSlot {
pub in_flight: AtomicUsize,
/* private fields */
}Expand description
One slot in the per-DC connection pool.
Each slot is backed by a background sender task (see
crate::sender_task::spawn_sender_task), not a locked DcConnection.
Enqueueing a request just posts it to the task’s mpsc channel and waits
on a oneshot for the result: no lock is held across the network round
trip, so any number of callers can have requests in flight on the same
slot at once. The task itself batches whatever is pending into as few
frames as possible and matches replies back to callers by msg_id,
regardless of the order responses arrive in.
in_flight still lets the pool pick the least-busy slot without needing
to touch the connection itself.
Fields§
§in_flight: AtomicUsizeAuto Trait Implementations§
impl !Freeze for ConnSlot
impl RefUnwindSafe for ConnSlot
impl Send for ConnSlot
impl Sync for ConnSlot
impl Unpin for ConnSlot
impl UnsafeUnpin for ConnSlot
impl UnwindSafe for ConnSlot
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