Trait FutureInheritTaskLocal

Source
pub trait FutureInheritTaskLocal: Future + Sized {
    // Required method
    fn inherit_task_local(
        self,
    ) -> TaskLocalFuture<TaskLocalInheritableTable, Self>;
}
Expand description

Extends any Future with a 'static lifetime. Provides a method that copies references to the current inheritable task local values into this Future.

Required Methods§

Source

fn inherit_task_local(self) -> TaskLocalFuture<TaskLocalInheritableTable, Self>

Copies references to the inheritable task local values that are currently available into this Future. These copied references will be available after the Future has been spawned onto a tokio runtime.

§Example
use tokio_inherit_task_local::FutureInheritTaskLocal as _;

tokio::spawn(a_future.inherit_task_local());

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§

Source§

impl<F> FutureInheritTaskLocal for F
where F: Future + 'static,