pub trait LocalExecutor {
// Required method
fn spawn<T: 'static>(
&self,
fut: impl Future<Output = T> + 'static,
) -> impl LocalTask<Output = T>;
}
Expand description
A trait for executor implementations that can spawn futures on the current thread.
This trait represents executors that operate within a single thread context,
allowing them to work with futures that are not Send
. This is essential for
working with non-thread-safe types like Rc, RefCell, or thread-local storage.
Required Methods§
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.