pub struct Threadpool { /* private fields */ }Implementations§
Source§impl Threadpool
impl Threadpool
Sourcepub fn spawn_local<'pool, F, R>(
&'pool self,
func: F,
) -> SpawnFuture<'pool, F, R>
pub fn spawn_local<'pool, F, R>( &'pool self, func: F, ) -> SpawnFuture<'pool, F, R>
Queue a new command for execution on this pool with access to the local variables.
The future of this function will block the current thread if it is not fully completed.
Sourcepub fn build_global(self) -> Result<(), Error>
pub fn build_global(self) -> Result<(), Error>
Set this threadpool as the global threadpool.
Sourcepub fn thread_count(&self) -> usize
pub fn thread_count(&self) -> usize
Get the total number of worker threads in this pool.
Sourcepub fn num_threads(&self) -> usize
pub fn num_threads(&self) -> usize
Get the specified number of threads for this pool.
Trait Implementations§
Source§impl Debug for Threadpool
impl Debug 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