pub struct ResponseInterceptorContext<'a> {
pub request: &'a Request,
pub start_time: Instant,
pub request_ctx: &'a RequestContext,
}Expand description
Context provided to response interceptors.
Contains information about the original request and timing data that interceptors might need to process responses.
Fields§
§request: &'a RequestThe original request (read-only).
start_time: InstantWhen the request processing started.
request_ctx: &'a RequestContextThe request context for cancellation support.
Implementations§
Source§impl<'a> ResponseInterceptorContext<'a>
impl<'a> ResponseInterceptorContext<'a>
Sourcepub fn new(
request: &'a Request,
request_ctx: &'a RequestContext,
start_time: Instant,
) -> Self
pub fn new( request: &'a Request, request_ctx: &'a RequestContext, start_time: Instant, ) -> Self
Create a new interceptor context.
Sourcepub fn elapsed_ms(&self) -> u128
pub fn elapsed_ms(&self) -> u128
Get the elapsed time in milliseconds.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ResponseInterceptorContext<'a>
impl<'a> !RefUnwindSafe for ResponseInterceptorContext<'a>
impl<'a> Send for ResponseInterceptorContext<'a>
impl<'a> Sync for ResponseInterceptorContext<'a>
impl<'a> Unpin for ResponseInterceptorContext<'a>
impl<'a> !UnwindSafe for ResponseInterceptorContext<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).