Struct ThreadPool
pub struct ThreadPool(/* private fields */);Implementations§
§impl ThreadPool
impl ThreadPool
pub fn from_env() -> Self
pub fn new(num_threads: usize) -> Self
pub fn with_name(name: String, num_threads: usize) -> Self
pub fn execute<F>(&self, job: F)
pub fn execute<F>(&self, job: F)
Executes the function job on a thread in the pool.
pub fn join(&self)
pub fn join(&self)
Block the current thread until all jobs in the pool have been executed.
pub fn scope<'env, F, T>(&self, f: F) -> T
Trait Implementations§
§impl Clone for ThreadPool
impl Clone for ThreadPool
§fn clone(&self) -> ThreadPool
fn clone(&self) -> ThreadPool
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 more§impl From<ThreadPool> for ThreadPool
impl From<ThreadPool> for ThreadPool
§fn from(pool: ThreadPool) -> Self
fn from(pool: ThreadPool) -> Self
Converts to this type from the input type.
§impl PartialEq for ThreadPool
impl PartialEq for ThreadPool
impl Eq for ThreadPool
impl StructuralPartialEq for ThreadPool
Auto Trait Implementations§
impl Freeze for ThreadPool
impl RefUnwindSafe for ThreadPool
impl Send for ThreadPool
impl Sync for ThreadPool
impl Unpin for ThreadPool
impl UnwindSafe for ThreadPool
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