Expand description
CorrelationId newtype for cross-service request correlation.
A CorrelationId is distinct from a crate::request_id::RequestId:
RequestIdidentifies a single HTTP request at the edge.CorrelationIdgroups related requests across multiple services (e.g. an entire user-initiated action that fans out to N microservices).
The value is an opaque string transported in the X-Correlation-Id
HTTP header. UUID v4 generation is provided for convenience.
§Example
use api_bones::correlation_id::CorrelationId;
let id = CorrelationId::new_uuid();
assert_eq!(id.header_name(), "X-Correlation-Id");
let parsed: CorrelationId = "my-correlation-123".parse().unwrap();
assert_eq!(parsed.as_str(), "my-correlation-123");Structs§
- Correlation
Id - An opaque cross-service correlation identifier, transported via
X-Correlation-Id.
Enums§
- Correlation
IdError - Error returned when constructing a
CorrelationIdfrom a string fails.