pub struct AllstakHttpMiddleware { /* private fields */ }Expand description
reqwest middleware that traces and records outbound HTTP requests.
Behaviour is individually toggleable: span emission, header injection and request recording can each be turned off, but all are on by default.
Implementations§
Source§impl AllstakHttpMiddleware
impl AllstakHttpMiddleware
Sourcepub fn enable_span(self, enable: bool) -> Self
pub fn enable_span(self, enable: bool) -> Self
Toggle opening an http.client child span per request.
Sourcepub fn enable_header_injection(self, enable: bool) -> Self
pub fn enable_header_injection(self, enable: bool) -> Self
Toggle injecting traceparent / X-AllStak-* headers downstream.
Sourcepub fn enable_request_record(self, enable: bool) -> Self
pub fn enable_request_record(self, enable: bool) -> Self
Toggle recording an outbound HttpRequestRecord.
Trait Implementations§
Source§impl Clone for AllstakHttpMiddleware
impl Clone for AllstakHttpMiddleware
Source§fn clone(&self) -> AllstakHttpMiddleware
fn clone(&self) -> AllstakHttpMiddleware
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AllstakHttpMiddleware
impl Debug for AllstakHttpMiddleware
Source§impl Default for AllstakHttpMiddleware
impl Default for AllstakHttpMiddleware
Source§impl Middleware for AllstakHttpMiddleware
impl Middleware for AllstakHttpMiddleware
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 Freeze for AllstakHttpMiddleware
impl RefUnwindSafe for AllstakHttpMiddleware
impl Send for AllstakHttpMiddleware
impl Sync for AllstakHttpMiddleware
impl Unpin for AllstakHttpMiddleware
impl UnsafeUnpin for AllstakHttpMiddleware
impl UnwindSafe for AllstakHttpMiddleware
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