Function std::future::get_task_cx[][src]

pub fn get_task_cx<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 task has been set or if the task context has already been retrived by a surrounding call to get_task_cx.