pub struct HttpClientMiddleware { /* private fields */ }Expand description
reqwest-middleware middleware that records each request: a client span,
trace context sent along, and http.client.request.duration. See the
crate documentation.
Implementations§
Source§impl HttpClientMiddleware
impl HttpClientMiddleware
Sourcepub fn with_propagation(self, enabled: bool) -> Self
pub fn with_propagation(self, enabled: bool) -> Self
Send W3C trace context with each request. Default: true. Turn it off for requests leaving your trust boundary.
Sourcepub fn with_metrics(self, enabled: bool) -> Self
pub fn with_metrics(self, enabled: bool) -> Self
Record http.client.request.duration. Default: true.
Trait Implementations§
Source§impl Clone for HttpClientMiddleware
impl Clone for HttpClientMiddleware
Source§impl Debug for HttpClientMiddleware
impl Debug for HttpClientMiddleware
Source§impl Default for HttpClientMiddleware
impl Default for HttpClientMiddleware
Source§impl Middleware for HttpClientMiddleware
impl Middleware for HttpClientMiddleware
Source§fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: Request,
extensions: &'life1 mut Extensions,
next: Next<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: Request,
extensions: &'life1 mut Extensions,
next: Next<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Invoked with a request before sending it. If you want to continue processing the request,
you should explicitly call
next.run(req, extensions). Read moreAuto Trait Implementations§
impl Forget for HttpClientMiddleware
impl Freeze for HttpClientMiddleware
impl Move for HttpClientMiddleware
impl RefUnwindSafe for HttpClientMiddleware
impl Send for HttpClientMiddleware
impl Sync for HttpClientMiddleware
impl Unpin for HttpClientMiddleware
impl UnsafeUnpin for HttpClientMiddleware
impl UnwindSafe for HttpClientMiddleware
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