pub trait Executor {
// Required method
fn spawn<T: Send + 'static>(
&self,
fut: impl Future<Output = T> + Send + 'static,
) -> impl Task<Output = T>;
}
Expand description
A trait for executor implementations that can spawn thread-safe futures.
This trait represents executors capable of running concurrent tasks that are Send
,
meaning they can be safely moved between threads. Implementors provide the core
functionality for task spawning in a multi-threaded context.
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.