pub struct ThreadPoolExecutor { /* private fields */ }Expand description
A handle to a threadpool_executor
See module level documentation for usage information.
Implementations§
Source§impl ThreadPoolExecutor
impl ThreadPoolExecutor
Sourcepub fn new(threads: usize) -> ThreadPoolExecutor
pub fn new(threads: usize) -> ThreadPoolExecutor
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::threadpool_executor::ThreadPoolExecutor;
let pool = ThreadPoolExecutor::new(4);Trait Implementations§
Source§impl CanExecute for ThreadPoolExecutor
impl CanExecute for ThreadPoolExecutor
Source§impl Clone for ThreadPoolExecutor
impl Clone for ThreadPoolExecutor
Source§fn clone(&self) -> ThreadPoolExecutor
fn clone(&self) -> ThreadPoolExecutor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThreadPoolExecutor
impl Debug for ThreadPoolExecutor
Source§impl Default for ThreadPoolExecutor
Create a thread pool with one thread per CPU.
On machines with hyperthreading,
this will create one thread per hyperthread.
impl Default for ThreadPoolExecutor
Create a thread pool with one thread per CPU. On machines with hyperthreading, this will create one thread per hyperthread.
Auto Trait Implementations§
impl Freeze for ThreadPoolExecutor
impl RefUnwindSafe for ThreadPoolExecutor
impl Send for ThreadPoolExecutor
impl Sync for ThreadPoolExecutor
impl Unpin for ThreadPoolExecutor
impl UnwindSafe for ThreadPoolExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more