struct PendingInbound<'a> {
pair: Option<(FramedSendStream, FramedRecvStream)>,
queue: &'a Mutex<VecDeque<(FramedSendStream, FramedRecvStream)>>,
}Expand description
Holds a peer-opened stream pair while its first message is being read, and puts it back on the connection’s queue if that read is abandoned.
Connection::accept_namespace_stream awaits a whole control message, and
a caller may drop that future — a select! against a shutdown signal is
the ordinary reason. Without this the stream, and every byte already read
off it into the reader’s buffer, would go with the future: the peer would
see its subscription reset for no reason it could act on.
Drop is the only place this can run, because a cancelled future is
never polled again. Every path that finishes — success or error — takes the
pair out first, so a pair still present when this drops was cancelled.
Fields§
§pair: Option<(FramedSendStream, FramedRecvStream)>§queue: &'a Mutex<VecDeque<(FramedSendStream, FramedRecvStream)>>Trait Implementations§
Source§impl Drop for PendingInbound<'_>
impl Drop for PendingInbound<'_>
Auto Trait Implementations§
impl<'a> Freeze for PendingInbound<'a>
impl<'a> RefUnwindSafe for PendingInbound<'a>
impl<'a> Send for PendingInbound<'a>
impl<'a> Sync for PendingInbound<'a>
impl<'a> Unpin for PendingInbound<'a>
impl<'a> UnsafeUnpin for PendingInbound<'a>
impl<'a> UnwindSafe for PendingInbound<'a>
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