pub enum JobTask {
External(ChildProcess),
Internal(TaskHandle<Result<ExecutionResult, Error>>),
}Expand description
Represents a task that is part of a job.
Variants§
External(ChildProcess)
An external process.
Internal(TaskHandle<Result<ExecutionResult, Error>>)
An internal asynchronous task.
Implementations§
Source§impl JobTask
impl JobTask
Sourcepub const fn is_external(&self) -> bool
pub const fn is_external(&self) -> bool
Returns whether the task is an external process.
Sourcepub async fn wait(&mut self) -> Result<JobTaskWaitResult, Error>
pub async fn wait(&mut self) -> Result<JobTaskWaitResult, Error>
Waits for the task to complete. Returns the result of the wait.
§Errors
Returns an error if waiting on an external process fails, if an internal task fails to join (for example when it panicked or was cancelled), or if the internal task itself returns an error.
Auto Trait Implementations§
impl !RefUnwindSafe for JobTask
impl !UnwindSafe for JobTask
impl Freeze for JobTask
impl Send for JobTask
impl Sync for JobTask
impl Unpin for JobTask
impl UnsafeUnpin for JobTask
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more