pub(super) struct Pending {
pub(super) requests: HashMap<Arc<str>, PendingRequest>,
pub(super) deadlines: DelayQueue<Arc<str>>,
pub(super) resets: FuturesUnordered<Pin<Box<dyn Future<Output = Option<Arc<str>>> + Send>>>,
}Expand description
The requests waiting for their second stream, with their deadlines and the watches of their streams. All are bounded by the streams of a connection.
Fields§
§requests: HashMap<Arc<str>, PendingRequest>§deadlines: DelayQueue<Arc<str>>§resets: FuturesUnordered<Pin<Box<dyn Future<Output = Option<Arc<str>>> + Send>>>The watches of the waiting streams, which let go of a stream once the client reset it. Otherwise the streams of a client which opens and resets them would count against the most streams of its connection until their deadline, as no new stream which could free them gets accepted once there is no room left.
Implementations§
Source§impl Pending
impl Pending
Sourcefn wait(
request_id: &Arc<str>,
stream: Stream,
) -> (Waiting, Pin<Box<dyn Future<Output = Option<Arc<str>>> + Send>>)
fn wait( request_id: &Arc<str>, stream: Stream, ) -> (Waiting, Pin<Box<dyn Future<Output = Option<Arc<str>>> + Send>>)
A stream of a request which waits for the other one, and the watch
for its reset, see Self::resets.
Sourcepub(super) fn get_or_insert(
&mut self,
request_id: &Arc<str>,
) -> &mut PendingRequest
pub(super) fn get_or_insert( &mut self, request_id: &Arc<str>, ) -> &mut PendingRequest
The request, created with its deadline if it is new.
Sourcepub(super) fn remove(&mut self, request_id: &str) -> Option<PendingRequest>
pub(super) fn remove(&mut self, request_id: &str) -> Option<PendingRequest>
Remove a request, with its deadline.
Sourcepub(super) fn remove_reset(&mut self, request_id: &str)
pub(super) fn remove_reset(&mut self, request_id: &str)
Let go of the streams of a request which the client reset, and of the request once it has no stream left.
Auto Trait Implementations§
impl !Freeze for Pending
impl !RefUnwindSafe for Pending
impl !Sync for Pending
impl !UnwindSafe for Pending
impl Send for Pending
impl Unpin for Pending
impl UnsafeUnpin for Pending
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].