Skip to main content

with_inherited_headless_step_scope

Function with_inherited_headless_step_scope 

pub async fn with_inherited_headless_step_scope<T>(
    scope: Option<HeadlessStepScope>,
    future: impl Future<Output = T>,
) -> T
Expand description

Re-establish an inherited scope on a task that could not inherit it.

A task-local does not cross spawn, so a caller that hands step work to a background task captures active_headless_step_scope first and restores it inside. None runs future unchanged.