Skip to main content

Module context

Module context 

Source
Expand description

The per-request Context.

Everything a request carries travels in one value, passed down explicitly: the correlation id, the authenticated principal, the tenant, and any metadata bound along the way. The ash-log scope lives inside it — see Context::scope — so callers never build one themselves.

Explicit passing rather than a thread-local is deliberate. ash_log::Scope is bound per-thread, so it does not survive an .await that moves the task to another worker. A Context is owned data: it crosses await points and thread boundaries intact, and Context::scope re-enters the ash-log scope wherever the work actually lands.

Structs§

Context
Everything one request carries.