[][src]Function std::future::get_task_context

pub fn get_task_context<F, R>(f: F) -> R where
    F: FnOnce(&mut Context) -> R, 
🔬 This is a nightly-only experimental API. (gen_future #50547)

Retrieves the thread-local task context used by async/await futures.

This function acquires exclusive access to the task context.

Panics if no context has been set or if the context has already been retrieved by a surrounding call to get_task_context.