pub struct TokioTaskExecutor { /* private fields */ }Expand description
In-process task executor using Tokio runtime.
Implementations§
Trait Implementations§
Source§impl Default for TokioTaskExecutor
impl Default for TokioTaskExecutor
Source§impl TaskExecutor for TokioTaskExecutor
impl TaskExecutor for TokioTaskExecutor
Source§fn start_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
work: BoxedTaskWork,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn TaskHandle>, TaskStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
work: BoxedTaskWork,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn TaskHandle>, TaskStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start executing a task. Returns an opaque handle for cancellation.
Source§fn cancel_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), TaskStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cancel_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), TaskStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Cancel a running task by ID.
Source§fn await_terminal<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<TaskStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn await_terminal<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<TaskStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Block until a task reaches terminal status.
Returns the terminal status, or None if the task is not tracked by this executor.
Auto Trait Implementations§
impl Freeze for TokioTaskExecutor
impl !RefUnwindSafe for TokioTaskExecutor
impl Send for TokioTaskExecutor
impl Sync for TokioTaskExecutor
impl Unpin for TokioTaskExecutor
impl UnsafeUnpin for TokioTaskExecutor
impl !UnwindSafe for TokioTaskExecutor
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.