pub enum TaskState {
Running,
Settled(Value),
Failed(RuntimeError),
Cancelled,
}Expand description
What a spawned task has done so far.
Variants§
Running
The body is running on its own thread, which has not been joined yet.
Settled(Value)
The body produced a value. Awaiting again returns the same value.
Failed(RuntimeError)
The body raised a RuntimeError. Awaiting again raises the same one.
Cancelled
The task was cancelled: its own flag was raised, and it stopped at the next safepoint rather than finishing. Awaiting a cancelled task is an error.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TaskState
impl !Send for TaskState
impl !Sync for TaskState
impl !UnwindSafe for TaskState
impl Freeze for TaskState
impl Unpin for TaskState
impl UnsafeUnpin for TaskState
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