Skip to main content

Module correlation

Module correlation 

Source
Expand description

Per-request correlation context.

CorrelationContext carries request-scoped state — correlation and request IDs, flow marker, user ID, raw body, headers, query parameters, decoded multipart payload, arbitrary key/value data, and pagination state — through handlers. It is cheaply clonable via Arc and can also be propagated via the CORRELATION_CTX task-local.

let ctx = CorrelationContext::new();
let page: Option<String> = ctx.query_param("page");

Structs§

CorrelationContext
Per-request correlation context. Cheaply clonable via Arc. Shares the underlying request state; mutating one clone is visible to the others.

Enums§

CorrelationFlow
Lifecycle marker for a correlated unit of work.

Statics§

CORRELATION_CTX
Task-local CorrelationContext for the current async task, when set by the dispatcher.