pub struct MetricsLayer;Expand description
Middleware that records per-route request counts and latency histograms.
Wrap any application with this layer once at startup; the data is collected
into a global store and emitted via GET /metrics.
use rust_web_server::app::App;
use rust_web_server::core::New;
use rust_web_server::metrics::MetricsLayer;
let app = App::new().wrap(MetricsLayer);Trait Implementations§
Source§impl Middleware for MetricsLayer
impl Middleware for MetricsLayer
fn handle( &self, request: &Request, connection: &ConnectionInfo, next: &dyn Application, ) -> Result<Response, String>
Auto Trait Implementations§
impl Freeze for MetricsLayer
impl RefUnwindSafe for MetricsLayer
impl Send for MetricsLayer
impl Sync for MetricsLayer
impl Unpin for MetricsLayer
impl UnsafeUnpin for MetricsLayer
impl UnwindSafe for MetricsLayer
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