Skip to main content

Module log_context

Module log_context 

Source
Expand description

Ergonomic glue between domain types and the [LogContext] requester slot.

Auth-resolution sites can call value.maybe_record_as_requester() on a [User], [BrowserSession], [Session], [CompatSession] or [Client] instead of reaching for [LogContext::maybe_set_requester] + [Requester] directly. Each call site should record the entity that authenticated the request exactly once; [LogContext] is first-writer-wins, so an accidental second call is harmless.

Traitsยง

RecordAsRequester