Skip to main content

extract_context

Function extract_context 

Source
pub fn extract_context(ctx: &ActorContext) -> Option<ContextSnapshot>
Expand description

Extract the propagated context snapshot from actor message headers.

Checks for a ContextSnapshotHeader (local hop) first, then falls back to ContextHeader (remote wire bytes). Returns None if no propagated context is present.

Useful for advanced scenarios such as spawning sub-tasks that need the propagated context, or inspecting context values without relying on the task-local scope.