pub enum TaskResult<T> {
Success {
task_id: usize,
value: T,
duration: Duration,
},
Error(TaskError),
}Expand description
Result of a single task.
Variants§
Implementations§
Source§impl<T> TaskResult<T>
impl<T> TaskResult<T>
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if the task succeeded.
Sourcepub fn into_value(self) -> Option<T>
pub fn into_value(self) -> Option<T>
Get the value if successful.
Sourcepub fn into_error(self) -> Option<TaskError>
pub fn into_error(self) -> Option<TaskError>
Get the error if failed.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TaskResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for TaskResult<T>where
T: RefUnwindSafe,
impl<T> Send for TaskResult<T>where
T: Send,
impl<T> Sync for TaskResult<T>where
T: Sync,
impl<T> Unpin for TaskResult<T>where
T: Unpin,
impl<T> UnwindSafe for TaskResult<T>where
T: 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