[−][src]Struct threads_pool::ThreadPool
Methods
impl ThreadPool
[src]
pub fn new(size: usize) -> ThreadPool
[src]
pub fn new_with_config(size: usize, config: Config) -> ThreadPool
[src]
pub fn set_exec_timeout(&mut self, timeout: Option<Duration>)
[src]
pub fn toggle_auto_scale(&mut self, auto_scale: bool)
[src]
pub fn exec<F: FnOnce() + Send + 'static>(
&mut self,
f: F,
prioritized: bool
) -> Result<(), ExecutionError>
[src]
&mut self,
f: F,
prioritized: bool
) -> Result<(), ExecutionError>
pub fn execute<F: FnOnce() + Send + 'static>(
&self,
f: F
) -> Result<(), ExecutionError>
[src]
&self,
f: F
) -> Result<(), ExecutionError>
pub fn execute_with_autoscale<F: FnOnce() + Send + 'static>(
&mut self,
f: F
) -> Result<(), ExecutionError>
[src]
&mut self,
f: F
) -> Result<(), ExecutionError>
Deprecated since 0.1.10:
Setup auto-scale using self.toggle_auto_scale(true), then call function self.exec(...) instead; this API will be removed in 0.2.0
Trait Implementations
impl ThreadPoolStates for ThreadPool
[src]
fn set_exec_timeout(&mut self, timeout: Option<Duration>)
[src]
fn get_exec_timeout(&self) -> Option<Duration>
[src]
fn toggle_auto_scale(&mut self, auto_scale: bool)
[src]
fn auto_scale_enabled(&self) -> bool
[src]
impl PoolManager for ThreadPool
[src]
fn extend(&mut self, more: usize)
[src]
fn shrink(&mut self, less: usize)
[src]
fn resize(&mut self, total: usize)
[src]
fn auto_adjust(&mut self)
[src]
fn auto_expire(&mut self, life: Option<Duration>)
[src]
fn kill_worker(&mut self, id: usize)
[src]
fn clear(&mut self)
[src]
fn close(&mut self)
[src]
fn force_close(&mut self)
[src]
impl PoolState for ThreadPool
[src]
fn get_size(&self) -> usize
[src]
fn get_queue_length(&self) -> usize
[src]
fn get_priority_queue_length(&self) -> usize
[src]
fn get_queue_size_threshold(&self) -> usize
[src]
fn set_queue_size_threshold(&mut self, threshold: usize)
[src]
fn get_first_worker_id(&self) -> Option<usize>
[src]
fn get_last_worker_id(&self) -> Option<usize>
[src]
fn get_next_worker_id(&self, current_id: usize) -> Option<usize>
[src]
impl Drop for ThreadPool
[src]
Auto Trait Implementations
impl Sync for ThreadPool
impl Send for ThreadPool
impl Unpin for ThreadPool
impl !RefUnwindSafe for ThreadPool
impl !UnwindSafe for ThreadPool
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,