[][src]Struct executors::crossbeam_workstealing_pool::ThreadPool

pub struct ThreadPool { /* fields omitted */ }

Methods

impl ThreadPool[src]

pub fn new(threads: usize) -> ThreadPool[src]

Creates a new thread pool capable of executing threads number of jobs concurrently.

Panics

This function will panic if threads is 0.

Examples

Create a new thread pool capable of executing four jobs concurrently:

use executors::*;
use executors::crossbeam_workstealing_pool::ThreadPool;

let pool = ThreadPool::new(4);

Trait Implementations

impl Executor for ThreadPool[src]

fn shutdown(self) -> Result<(), String>[src]

Shutdown an Executor and wait for it to shut down all workers. Read more

impl Default for ThreadPool[src]

Create a thread pool with one thread per CPU. On machines with hyperthreading, this will create one thread per hyperthread.

impl Clone for ThreadPool[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ThreadPool[src]

Auto Trait Implementations

impl Send for ThreadPool

impl Sync for ThreadPool

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]