Struct MetricsHandler

Source
pub struct MetricsHandler;
Expand description

A handler for exposing prometheus metrics.

Trait Implementations§

Source§

impl Debug for MetricsHandler

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl HandleRequest for MetricsHandler

Source§

const METHOD: &'static str = "GET"

The method that the handler can handle.
Source§

const PATH: &'static str = "/metrics"

The request path that the handler can handle. Read more
Source§

type ReqBody = ()

The type of the request bodies.
Source§

type ResBody = String

The type of the response bodies.
Source§

type Decoder = BodyDecoder<NullDecoder>

Request body decoder.
Source§

type Encoder = BodyEncoder<Utf8Encoder>

Response body encoder.
Source§

type Reply = Box<dyn Future<Item = Res<<MetricsHandler as HandleRequest>::ResBody>, Error = Never> + Send>

Future that represents reply to a request.
Source§

fn handle_request(&self, _req: Req<Self::ReqBody>) -> Self::Reply

Handles a request.
Source§

fn handle_request_head(&self, req: &Req<()>) -> Option<Res<Self::ResBody>>

Handles the head part of a request. Read more
Source§

fn handle_decoding_error( &self, req: Req<()>, error: &Error, ) -> Option<Res<Self::ResBody>>

Handles an error occurred while decoding the body of a request. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,