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 new() -> RequestIdConfig
pub fn new() -> RequestIdConfig
Creates a new configuration with defaults.
Sourcepub fn header_name(self, name: impl Into<String>) -> RequestIdConfig
pub fn header_name(self, name: impl Into<String>) -> RequestIdConfig
Sets the header name for request ID.
Sourcepub fn accept_from_client(self, accept: bool) -> RequestIdConfig
pub fn accept_from_client(self, accept: bool) -> RequestIdConfig
Sets whether to accept request ID from client.
Sourcepub fn add_to_response(self, add: bool) -> RequestIdConfig
pub fn add_to_response(self, add: bool) -> RequestIdConfig
Sets whether to add request ID to response.
Sourcepub fn max_client_id_length(self, max: usize) -> RequestIdConfig
pub fn max_client_id_length(self, max: usize) -> RequestIdConfig
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
Source§impl Default for RequestIdConfig
impl Default for RequestIdConfig
Source§fn default() -> RequestIdConfig
fn default() -> RequestIdConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RequestIdConfig
impl RefUnwindSafe for RequestIdConfig
impl Send for RequestIdConfig
impl Sync for RequestIdConfig
impl Unpin for RequestIdConfig
impl UnsafeUnpin 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).