pub struct ThreadPool { /* private fields */ }Expand description
Implementations§
Source§impl ThreadPool
impl ThreadPool
Sourcepub fn new() -> Self
pub fn new() -> Self
Will return ThreadPool with capacity = logical-cores - 1
all the threads will spawn immediately
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Will return ThreadPool with user defined capacity
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns ThreadPool capacity
Sourcepub fn check_panics(&self) -> usize
pub fn check_panics(&self) -> usize
Returns an amount of threads panicking
Sourcepub fn check_busy(&self) -> usize
pub fn check_busy(&self) -> usize
Returns an amount of busy threads
Trait Implementations§
Source§impl Debug for ThreadPool
impl Debug for ThreadPool
Source§impl Default for ThreadPool
impl Default 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