pub trait ContextExt: Runtime {
    // Required methods
    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§

source

fn scope<F, R>( locals: TaskLocals, fut: F ) -> Pin<Box<dyn Future<Output = R> + Send>>where F: Future<Output = R> + Send + 'static,

Set the task locals for the given future

source

fn get_task_locals() -> Option<TaskLocals>

Get the task locals for the current task

Implementors§