Struct merino_web::middleware::metrics::MetricsMiddleware
source · [−]pub struct MetricsMiddleware<S> {
service: S,
}
Expand description
Middleware to record request metrics.
Fields
service: S
The wrapped service.
Trait Implementations
sourceimpl<S, B> Service<ServiceRequest> for MetricsMiddleware<S> where
S: Service<ServiceRequest, Response = ServiceResponse<B>>,
B: 'static + MessageBody,
S::Future: 'static,
S::Error: Debug,
impl<S, B> Service<ServiceRequest> for MetricsMiddleware<S> where
S: Service<ServiceRequest, Response = ServiceResponse<B>>,
B: 'static + MessageBody,
S::Future: 'static,
S::Error: Debug,
type Response = <S as Service<ServiceRequest>>::Response
type Response = <S as Service<ServiceRequest>>::Response
Responses given by the service.
type Future = Pin<Box<dyn Future<Output = Result<<MetricsMiddleware<S> as Service<ServiceRequest>>::Response, <MetricsMiddleware<S> as Service<ServiceRequest>>::Error>> + 'static, Global>>
type Future = Pin<Box<dyn Future<Output = Result<<MetricsMiddleware<S> as Service<ServiceRequest>>::Response, <MetricsMiddleware<S> as Service<ServiceRequest>>::Error>> + 'static, Global>>
The future response value.
sourcefn poll_ready(&self, ctx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&self, ctx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Ready
when the service is able to process requests. Read more
sourcefn call(&self, req: ServiceRequest) -> Self::Future
fn call(&self, req: ServiceRequest) -> Self::Future
Process the request and return the response asynchronously. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for MetricsMiddleware<S> where
S: RefUnwindSafe,
impl<S> Send for MetricsMiddleware<S> where
S: Send,
impl<S> Sync for MetricsMiddleware<S> where
S: Sync,
impl<S> Unpin for MetricsMiddleware<S> where
S: Unpin,
impl<S> UnwindSafe for MetricsMiddleware<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<'a, T, E> AsTaggedExplicit<'a, E> for T where
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for T where
T: 'a,
sourceimpl<'a, T, E> AsTaggedImplicit<'a, E> for T where
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for T where
T: 'a,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<S, Req> IntoService<S, Req> for S where
S: Service<Req>,
impl<S, Req> IntoService<S, Req> for S where
S: Service<Req>,
sourcefn into_service(self) -> S
fn into_service(self) -> S
Convert to a Service
sourceimpl<S, Req> ServiceExt<Req> for S where
S: Service<Req>,
impl<S, Req> ServiceExt<Req> for S where
S: Service<Req>,
sourcefn map<F, R>(self, f: F) -> Map<Self, F, Req, R> where
F: FnMut(Self::Response) -> R,
fn map<F, R>(self, f: F) -> Map<Self, F, Req, R> where
F: FnMut(Self::Response) -> R,
Map this service’s output to a different type, returning a new service of the resulting type. Read more
sourcefn map_err<F, E>(self, f: F) -> MapErr<Self, Req, F, E> where
F: Fn(Self::Error) -> E,
fn map_err<F, E>(self, f: F) -> MapErr<Self, Req, F, E> where
F: Fn(Self::Error) -> E,
Map this service’s error to a different error, returning a new service. Read more
sourcefn and_then<I, S1>(self, service: I) -> AndThenService<Self, S1, Req> where
I: IntoService<S1, Self::Response>,
S1: Service<Self::Response, Error = Self::Error>,
fn and_then<I, S1>(self, service: I) -> AndThenService<Self, S1, Req> where
I: IntoService<S1, Self::Response>,
S1: Service<Self::Response, Error = Self::Error>,
Call another service after call to this one has resolved successfully. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more