pub trait SpawnWorker<J, F>: Runtime + Sized {
// Required method
fn spawn_worker(
&self,
name: String,
worker: WorkerThread<J, Self>,
f: F,
) -> Result<Self::JoinHandle<()>, Self::SpawnError>;
}Expand description
A minimal description of a concurrent runtime that can spawn worker tasks
for topograph
Required Methods§
Sourcefn spawn_worker(
&self,
name: String,
worker: WorkerThread<J, Self>,
f: F,
) -> Result<Self::JoinHandle<()>, Self::SpawnError>
fn spawn_worker( &self, name: String, worker: WorkerThread<J, Self>, f: F, ) -> Result<Self::JoinHandle<()>, Self::SpawnError>
Spawn a new task to run the given worker with the given user-provided task
§Errors
This function may return an error if a task was unable to be spawned in the runtime
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.