Skip to main content

with_context

Function with_context 

Source
pub fn with_context<T>(ctx: AuditContext, f: impl FnOnce() -> T) -> T
Expand description

Run a synchronous audit-emitting block with transport context.

The auth pipeline is synchronous, so thread-local scoped context lets REST, gRPC, WS, and MCP adapters attach source metadata without changing every audit call site. Async code should wrap only the immediate synchronous audit::* / authenticate_request call, not an .await boundary.