pub struct AsyncifyPool { /* private fields */ }
Expand description
A thread pool to perform blocking operations in other threads.
Implementations§
source§impl AsyncifyPool
impl AsyncifyPool
sourcepub fn new(thread_limit: usize, recv_timeout: Duration) -> Self
pub fn new(thread_limit: usize, recv_timeout: Duration) -> Self
Create AsyncifyPool
with thread number limit and channel receive
timeout.
sourcepub fn dispatch<D: Dispatchable>(&self, f: D) -> Result<(), DispatchError<D>>
pub fn dispatch<D: Dispatchable>(&self, f: D) -> Result<(), DispatchError<D>>
Send a dispatchable, usually a closure, to another thread. Usually the user should not use it. When all threads are busy and thread number limit has been reached, it will return an error with the original dispatchable.
Trait Implementations§
source§impl Clone for AsyncifyPool
impl Clone for AsyncifyPool
source§fn clone(&self) -> AsyncifyPool
fn clone(&self) -> AsyncifyPool
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AsyncifyPool
impl RefUnwindSafe for AsyncifyPool
impl Send for AsyncifyPool
impl Sync for AsyncifyPool
impl Unpin for AsyncifyPool
impl UnwindSafe for AsyncifyPool
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)