pub enum RequestIdMode {
Permissive,
Strict,
}Expand description
Request ID validation behavior for inbound x-request-id values.
Valid inbound IDs must parse as UUID v4 values. Invalid header syntax, non-UUID strings, and UUIDs from other versions are treated as malformed. Missing IDs are never rejected; the configured generator is used instead.
Variants§
Permissive
Propagate valid UUID v4 IDs and replace malformed incoming IDs.
This mode is useful in development and at integration boundaries where clients may still send legacy IDs. A malformed inbound value is not exposed to handlers; it is replaced with a generated ID before the request reaches the inner service.
Strict
Propagate valid UUID v4 IDs and reject malformed incoming IDs.
A malformed inbound value returns 400 Bad Request with an
invalid_request_id JSON error body. The rejection response still
receives a generated request ID in the configured response header.
Trait Implementations§
Source§impl Clone for RequestIdMode
impl Clone for RequestIdMode
Source§fn clone(&self) -> RequestIdMode
fn clone(&self) -> RequestIdMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RequestIdMode
Source§impl Debug for RequestIdMode
impl Debug for RequestIdMode
impl Eq for RequestIdMode
Source§impl PartialEq for RequestIdMode
impl PartialEq for RequestIdMode
Source§fn eq(&self, other: &RequestIdMode) -> bool
fn eq(&self, other: &RequestIdMode) -> bool
self and other values to be equal, and is used by ==.