Trait concurrency_traits::ThreadSpawner [−][src]
pub trait ThreadSpawner { type SpawnReturn; type SpawnError; fn spawn(
self,
function: impl FnOnce() + 'static + Send
) -> Result<Self::SpawnReturn, Self::SpawnError>; }
A spawner for new threads.
Associated Types
type SpawnReturn
[src]
The return value from ThreadSpawner::spawn
type SpawnError
[src]
The error that can be returned
Required methods
fn spawn(
self,
function: impl FnOnce() + 'static + Send
) -> Result<Self::SpawnReturn, Self::SpawnError>
[src]
self,
function: impl FnOnce() + 'static + Send
) -> Result<Self::SpawnReturn, Self::SpawnError>
Spawns a new thread running function