Skip to main content

with_invocation_context

Function with_invocation_context 

Source
pub fn with_invocation_context<F, R>(f: F) -> Option<R>
where F: FnOnce(&InvocationContext) -> R,
Expand description

Access the current invocation context by reference, avoiding a clone when the tokio task-local is available.

Returns None when called outside a runner-managed task execution.