pub trait CpuPool: Send + Sync {
// Required method
fn spawn_raw(
&self,
task: Box<dyn FnOnce() + Send>,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send>>;
}Expand description
Dyn-compatible interface for a CPU-bound thread pool.
Use the blanket CpuPoolExt::spawn method for ergonomic, generic usage.
Implement only CpuPool::spawn_raw in concrete types.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".