pub struct ThreadPool {
pub(crate) inner: Arc<RwLock<Inner>>,
}
Fields§
§inner: Arc<RwLock<Inner>>
Implementations§
source§impl ThreadPool
impl ThreadPool
sourcepub fn new<P>(size: NonZero<usize>, panic_handler: P) -> Result<ThreadPool>
pub fn new<P>(size: NonZero<usize>, panic_handler: P) -> Result<ThreadPool>
Create a new ThreadPool
.
The size is the number of threads in the pool.
pub fn execute<F>(&self, f: F) -> Result<()>
pub fn set_size(&self, size: NonZero<usize>) -> Result<isize>
pub fn size(&self) -> Result<usize>
pub(crate) fn execute_unchecked<F>(&self, f: F) -> Result<()>
Trait Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)