Struct PendingRequests
pub struct PendingRequests<S, C = CompleteOnResponse> { /* private fields */ }
Measures the load of the underlying service using the number of currently-pending requests.
Implementations
impl<S, C> PendingRequests<S, C>
fn new(service: S, completion: C) -> SelfWraps an
S-typed service so that its load is tracked by the number of pending requests.
Trait Implementations
impl<S, C> Load for PendingRequests<S, C>
type Metric = Count;fn load(&self) -> Count
impl<S, C, Request> Service<Request> for PendingRequests<S, C>
where
S: Service<Request>,
C: TrackCompletion<Handle, S::Response>,
type Response = <C as TrackCompletion<Handle, <S as Service<Request>>::Response>>::Output;type Error = <S as Service<Request>>::Error;type Future = TrackCompletionFuture<<S as Service<Request>>::Future, C, Handle>;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>fn call(&mut self, req: Request) -> Self::Future
impl<S: Debug, C: Debug> Debug for PendingRequests<S, C>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<S, C> Freeze for PendingRequests<S, C>
where
S: Freeze,
C: Freeze,
impl<S, C> RefUnwindSafe for PendingRequests<S, C>
where
S: RefUnwindSafe,
C: RefUnwindSafe,
impl<S, C> Send for PendingRequests<S, C>
where
S: Send,
C: Send,
impl<S, C> Sync for PendingRequests<S, C>
where
S: Sync,
C: Sync,
impl<S, C> Unpin for PendingRequests<S, C>
where
S: Unpin,
C: Unpin,
impl<S, C> UnsafeUnpin for PendingRequests<S, C>
where
S: UnsafeUnpin,
C: UnsafeUnpin,
impl<S, C> UnwindSafe for PendingRequests<S, C>
where
S: UnwindSafe,
C: UnwindSafe,
Blanket Implementations
impl<C, Target> MakeConnection<Target> for PendingRequests<S, C>
where
C: Service<Target>,
<C as Service<Target>>::Response: AsyncRead + AsyncWrite,
type Connection = <C as Service<Target>>::Response;type Error = <C as Service<Target>>::Error;type Future = <C as Service<Target>>::Future;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <C as MakeConnection<Target>>::Error>>fn make_connection(&mut self, target: Target) -> <C as MakeConnection<Target>>::Future
impl<M, S, Target, Request> MakeService<Target, Request> for PendingRequests<S, C>
where
M: Service<Target, Response = S>,
S: Service<Request>,
type Response = <S as Service<Request>>::Response;type Error = <S as Service<Request>>::Error;type Service = S;type MakeError = <M as Service<Target>>::Error;type Future = <M as Service<Target>>::Future;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>fn make_service(&mut self, target: Target) -> <M as MakeService<Target, Request>>::Future
impl<T> Any for PendingRequests<S, C>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for PendingRequests<S, C>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for PendingRequests<S, C>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for PendingRequests<S, C>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for PendingRequests<S, C>
impl<T> WithSubscriber for PendingRequests<S, C>
impl<T, Request> ServiceExt<Request> for PendingRequests<S, C>
where
T: Service<Request> + ?Sized,
impl<T, U> Into<U> for PendingRequests<S, C>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for PendingRequests<S, C>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for PendingRequests<S, C>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>