pub struct WorkerPool { /* private fields */ }Implementations§
Source§impl WorkerPool
impl WorkerPool
pub fn new(n1: usize, n2: usize, n3: usize) -> Self
Sourcepub fn spawn<F, T>(
&self,
priority: Priority,
f: F,
) -> impl Future<Output = ClResult<T>>
pub fn spawn<F, T>( &self, priority: Priority, f: F, ) -> impl Future<Output = ClResult<T>>
Submit a closure with arguments → returns a Future for the result
pub fn run<F, T>(&self, f: F) -> impl Future<Output = ClResult<T>>
pub fn run_immed<F, T>(&self, f: F) -> impl Future<Output = ClResult<T>>
pub fn run_slow<F, T>(&self, f: F) -> impl Future<Output = ClResult<T>>
Sourcepub fn try_run<F, T>(&self, f: F) -> impl Future<Output = ClResult<T>>
pub fn try_run<F, T>(&self, f: F) -> impl Future<Output = ClResult<T>>
Like run, but flattens ClResult<ClResult<T>> into ClResult<T>.
Use when the closure itself returns ClResult<T>.
Sourcepub fn try_run_immed<F, T>(&self, f: F) -> impl Future<Output = ClResult<T>>
pub fn try_run_immed<F, T>(&self, f: F) -> impl Future<Output = ClResult<T>>
Like run_immed, but flattens ClResult<ClResult<T>> into ClResult<T>.
Use when the closure itself returns ClResult<T>.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkerPool
impl RefUnwindSafe for WorkerPool
impl Send for WorkerPool
impl Sync for WorkerPool
impl Unpin for WorkerPool
impl UnsafeUnpin for WorkerPool
impl UnwindSafe for WorkerPool
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