pub struct TraceMiddleware { /* private fields */ }
Expand description
A middleware for tracing HTTP requests.
This logs (using log
) each request, as well as how long each request
took. The default log level is info
.
Implementations§
Trait Implementations§
Source§impl Clone for TraceMiddleware
impl Clone for TraceMiddleware
Source§fn clone(&self) -> TraceMiddleware
fn clone(&self) -> TraceMiddleware
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TraceMiddleware
impl Debug for TraceMiddleware
Source§impl Default for TraceMiddleware
impl Default for TraceMiddleware
Source§fn default() -> TraceMiddleware
fn default() -> TraceMiddleware
Returns the “default value” for a type. Read more
Source§impl Middleware for TraceMiddleware
impl Middleware for TraceMiddleware
Source§fn apply<'life0, 'life1, 'async_trait>(
self: Pin<&'life0 Self>,
request: Request,
next: Next<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply<'life0, 'life1, 'async_trait>(
self: Pin<&'life0 Self>,
request: Request,
next: Next<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handles the given request, returning a response. The next parameter
contains the information on how to process everything after the current
middleware, i.e. generating a response from the endpoint.
Auto Trait Implementations§
impl Freeze for TraceMiddleware
impl RefUnwindSafe for TraceMiddleware
impl Send for TraceMiddleware
impl Sync for TraceMiddleware
impl Unpin for TraceMiddleware
impl UnwindSafe for TraceMiddleware
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