Trait concurrency_traits::ThreadSpawner[][src]

pub trait ThreadSpawner<O>: TryThreadSpawner<O, SpawnError = Infallible> where
    O: Send + 'static, 
{ fn spawn(func: impl FnOnce() -> O + 'static + Send) -> Self::ThreadHandle { ... } }
Expand description

Same as a TryThreadSpawner with an Infallible TryThreadSpawner::SpawnError. This is auto-implemented with TryThreadSpawner when possible. If a result is needed from the launched thread look to ResultThreadSpawner.

Provided methods

fn spawn(func: impl FnOnce() -> O + 'static + Send) -> Self::ThreadHandle[src]

Spawns a thread returning a TryThreadSpawner::ThreadHandle. Analog to std::thread::spawn. Will be faster on nightly due to Result::unwrap_unchecked.

Implementors

impl<T, O> ThreadSpawner<O> for T where
    T: TryThreadSpawner<O, SpawnError = Infallible>,
    O: Send + 'static, 
[src]