pub struct RequestIdConfig {
pub header_name: String,
pub accept_from_client: bool,
pub add_to_response: bool,
pub max_client_id_length: usize,
}Expand description
Configuration for request ID middleware.
Fields§
§header_name: StringHeader name to read/write request ID (default: “x-request-id”).
accept_from_client: boolWhether to accept request ID from client (default: true).
add_to_response: boolWhether to add request ID to response headers (default: true).
max_client_id_length: usizeMaximum length of client-provided request ID (default: 128).
Implementations§
Source§impl RequestIdConfig
impl RequestIdConfig
Sourcepub fn header_name(self, name: impl Into<String>) -> Self
pub fn header_name(self, name: impl Into<String>) -> Self
Sets the header name for request ID.
Sourcepub fn accept_from_client(self, accept: bool) -> Self
pub fn accept_from_client(self, accept: bool) -> Self
Sets whether to accept request ID from client.
Sourcepub fn add_to_response(self, add: bool) -> Self
pub fn add_to_response(self, add: bool) -> Self
Sets whether to add request ID to response.
Sourcepub fn max_client_id_length(self, max: usize) -> Self
pub fn max_client_id_length(self, max: usize) -> Self
Sets the maximum length for client-provided request IDs.
Trait Implementations§
Source§impl Clone for RequestIdConfig
impl Clone for RequestIdConfig
Source§fn clone(&self) -> RequestIdConfig
fn clone(&self) -> RequestIdConfig
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 RequestIdConfig
impl Debug for RequestIdConfig
Auto Trait Implementations§
impl Freeze for RequestIdConfig
impl RefUnwindSafe for RequestIdConfig
impl Send for RequestIdConfig
impl Sync for RequestIdConfig
impl Unpin for RequestIdConfig
impl UnwindSafe for RequestIdConfig
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).