pub struct ThreadPoolSyncHandler<Shared: 'static + Clone + Send> { /* private fields */ }
Expand description
Synchronous handler to execute jobs on the thread pool
Implementations§
Sourcepub fn execute<F, R>(&self, f: F) -> Result<R, ThreadPoolDisconnected>
pub fn execute<F, R>(&self, f: F) -> Result<R, ThreadPoolDisconnected>
Execute the given job and block the current thread until finished.
If you need a non blocking method, see ThreadPoolAsyncHandler
.
Sourcepub fn launch<F, R>(
&self,
f: F,
) -> Result<JoinHandle<R>, ThreadPoolDisconnected>
pub fn launch<F, R>( &self, f: F, ) -> Result<JoinHandle<R>, ThreadPoolDisconnected>
Launch the given job and return a oneshot receiver that listen job result.
If you need a non blocking method, see ThreadPoolAsyncHandler
.
Trait Implementations§
Source§fn clone(&self) -> ThreadPoolSyncHandler<Shared>
fn clone(&self) -> ThreadPoolSyncHandler<Shared>
Returns a duplicate 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§
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