Spawner

Trait Spawner 

Source
pub trait Spawner {
    // Required method
    fn spawn<F>(&self, f: F)
       where F: FnOnce() + Send + 'static;
}
Expand description

A trait for spawning threads.

Required Methods§

Source

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

Spawn a thread to run function f.

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.

Implementations on Foreign Types§

Source§

impl Spawner for ThreadPool

Available on crate feature threadpool only.
Source§

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

Implementors§