pub trait ContextExt: Runtime {
    fn scope<F, R>(
        locals: TaskLocals,
        fut: F
    ) -> Pin<Box<dyn Future<Output = R> + Send>>
    where
        F: Future<Output = R> + Send + 'static
; fn get_task_locals() -> Option<TaskLocals>; }
Expand description

Exposes the utilities necessary for using task-local data in the Runtime

Required Methods

Set the task locals for the given future

Get the task locals for the current task

Implementors