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>
Available on crate feature
futures only.