Struct ThreadPool
pub struct ThreadPool(/* private fields */);Implementations§
§impl ThreadPool
impl ThreadPool
pub fn exclusive(max_threads: u32) -> Result<ThreadPool, Error>
pub fn push<T, F>(&self, func: F) -> Result<ThreadHandle<T>, Error>
pub fn push_future<T, F>( &self, func: F, ) -> Result<impl Future<Output = Result<T, Box<dyn Any + Send>>> + 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§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more