pub struct TaskRunner<C> { /* private fields */ }Expand description
Runner that executes a callable task with standard task-handle semantics.
TaskRunner owns the accepted callable, converts task failures and panics
into TaskExecutionError, and can publish the final result through a
TaskCompletion endpoint.
Implementations§
Source§impl<C> TaskRunner<C>
impl<C> TaskRunner<C>
Sourcepub fn call<R, E>(self) -> TaskResult<R, E>where
C: Callable<R, E>,
pub fn call<R, E>(self) -> TaskResult<R, E>where
C: Callable<R, E>,
Runs the callable and converts task failure and panic into a handle result.
§Returns
Ok(R) if the task succeeds. If the task returns Err(E) or panics, the
corresponding TaskExecutionError is returned.
Sourcepub fn run<R, E>(self, completion: TaskCompletion<R, E>) -> boolwhere
C: Callable<R, E>,
pub fn run<R, E>(self, completion: TaskCompletion<R, E>) -> boolwhere
C: Callable<R, E>,
Auto Trait Implementations§
impl<C> Freeze for TaskRunner<C>where
C: Freeze,
impl<C> RefUnwindSafe for TaskRunner<C>where
C: RefUnwindSafe,
impl<C> Send for TaskRunner<C>where
C: Send,
impl<C> Sync for TaskRunner<C>where
C: Sync,
impl<C> Unpin for TaskRunner<C>where
C: Unpin,
impl<C> UnsafeUnpin for TaskRunner<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for TaskRunner<C>where
C: UnwindSafe,
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