[−][src]Struct executors::crossbeam_channel_pool::ThreadPool
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_channel_pool::ThreadPool; let pool = ThreadPool::new(4);
Trait Implementations
impl Executor for ThreadPool
[src]
fn execute<F>(&self, job: F) where
F: FnOnce() + Send + 'static,
[src]
F: FnOnce() + Send + 'static,
fn shutdown_async(&self)
[src]
fn shutdown_borrowed(&self) -> Result<(), String>
[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(&self) -> 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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,