pub struct ThreadPool(/* private fields */);
Implementations§
Source§impl ThreadPool
impl ThreadPool
pub fn exclusive(max_threads: u32) -> Result<Self, Error>
pub fn push<T: Send + 'static, F: FnOnce() -> T + Send + 'static>( &self, func: F, ) -> Result<ThreadHandle<T>, Error>
pub fn push_future<T: Send + 'static, F: FnOnce() -> T + Send + 'static>( &self, func: F, ) -> Result<impl Future<Output = Result<T>> + Send + Sync + 'static, Error>
pub fn set_max_threads(&self, max_threads: Option<u32>) -> Result<(), Error>
pub fn max_threads(&self) -> Option<u32>
pub fn num_threads(&self) -> u32
pub fn unprocessed(&self) -> u32
pub fn set_max_unused_threads(max_threads: Option<u32>)
pub fn max_unused_threads() -> Option<u32>
pub fn num_unused_threads() -> u32
pub fn stop_unused_threads()
pub fn set_max_idle_time(max_idle_time: u32)
pub fn max_idle_time() -> u32
Trait Implementations§
Source§impl Debug for ThreadPool
impl Debug for ThreadPool
Source§impl Drop for ThreadPool
impl Drop for ThreadPool
impl Send for ThreadPool
impl Sync for ThreadPool
Auto Trait Implementations§
impl Freeze for ThreadPool
impl RefUnwindSafe 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