Trait LocalContextExt

Source
pub trait LocalContextExt: Runtime {
    // Required method
    fn scope_local<F, R>(
        locals: TaskLocals,
        fut: F,
    ) -> Pin<Box<dyn Future<Output = R>>>
       where F: Future<Output = R> + 'static;
}
Expand description

Adds the ability to scope task-local data for !Send futures

Required Methods§

Source

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

Set the task locals for the given !Send future

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§