Struct spawner::Spawner [] [src]

pub struct Spawner {
    // some fields omitted
}

A wrapper for thread::spawn that optionally auto-joins threads.

Methods

impl Spawner
[src]

fn new() -> Spawner

Create a new Spawner object

fn spawn_collected<F>(&mut self, f: F) where F: FnOnce(), F: Send + 'static

Spawn a thread that will be auto-joined when the Spawner is dropped

The thread function should be a move closure returning ()

fn spawn<F, T>(&mut self, f: F) -> JoinHandle<T> where F: FnOnce() -> T, F: Send + 'static, T: Send + 'static

Spawn a thread that won't be auto-joined

The thread function should be a move closure

Trait Implementations

impl Drop for Spawner
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more