pub struct DebugInfoInterceptor { /* private fields */ }Expand description
Interceptor that adds debug information headers.
Useful for development/staging environments to expose internal processing information in response headers.
§Headers Added
X-Debug-Request-Id: The request ID (if available)X-Debug-Handler-Time: Handler execution timeX-Debug-Path: The request pathX-Debug-Method: The HTTP method
§Example
ⓘ
let interceptor = DebugInfoInterceptor::new()
.include_path(true)
.include_method(true);Implementations§
Source§impl DebugInfoInterceptor
impl DebugInfoInterceptor
Sourcepub fn include_path(self, include: bool) -> Self
pub fn include_path(self, include: bool) -> Self
Set whether to include the path.
Sourcepub fn include_method(self, include: bool) -> Self
pub fn include_method(self, include: bool) -> Self
Set whether to include the HTTP method.
Sourcepub fn include_request_id(self, include: bool) -> Self
pub fn include_request_id(self, include: bool) -> Self
Set whether to include the request ID.
Sourcepub fn include_timing(self, include: bool) -> Self
pub fn include_timing(self, include: bool) -> Self
Set whether to include timing information.
Sourcepub fn header_prefix(self, prefix: impl Into<String>) -> Self
pub fn header_prefix(self, prefix: impl Into<String>) -> Self
Set a custom header prefix.
Trait Implementations§
Source§impl Clone for DebugInfoInterceptor
impl Clone for DebugInfoInterceptor
Source§fn clone(&self) -> DebugInfoInterceptor
fn clone(&self) -> DebugInfoInterceptor
Returns a duplicate 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 DebugInfoInterceptor
impl Debug for DebugInfoInterceptor
Source§impl Default for DebugInfoInterceptor
impl Default for DebugInfoInterceptor
Auto Trait Implementations§
impl Freeze for DebugInfoInterceptor
impl RefUnwindSafe for DebugInfoInterceptor
impl Send for DebugInfoInterceptor
impl Sync for DebugInfoInterceptor
impl Unpin for DebugInfoInterceptor
impl UnwindSafe for DebugInfoInterceptor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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).