Trait concurrency_traits::ThreadSpawner[][src]

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

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(self, func: impl FnOnce() -> O + 'static + Send) -> Self::ThreadHandle[src]

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

Loading content...

Implementors

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

Loading content...