pub enum TaskResultValue {
Pending,
Received,
Started,
Success(Value),
Failure {
error: String,
traceback: Option<String>,
},
Revoked,
Retry {
attempt: u32,
max_retries: u32,
},
Rejected {
reason: String,
},
}Expand description
Task result value stored in backend
Variants§
Pending
Task is pending execution
Received
Task has been received by worker
Started
Task is currently running
Success(Value)
Task completed successfully with result
Failure
Task failed with error message and optional traceback
Revoked
Task was revoked/cancelled
Retry
Task is being retried
Rejected
Task was rejected (e.g., validation failed)
Implementations§
Source§impl TaskResultValue
impl TaskResultValue
Sourcepub const fn is_terminal(&self) -> bool
pub const fn is_terminal(&self) -> bool
Check if the result is in a terminal state
Sourcepub const fn is_pending(&self) -> bool
pub const fn is_pending(&self) -> bool
Check if the task is pending
Sourcepub const fn is_successful(&self) -> bool
pub const fn is_successful(&self) -> bool
Check if the task succeeded
Sourcepub fn success_value(&self) -> Option<&Value>
pub fn success_value(&self) -> Option<&Value>
Get the success value if available
Sourcepub fn error_message(&self) -> Option<&str>
pub fn error_message(&self) -> Option<&str>
Get the error message if failed
Trait Implementations§
Source§impl Clone for TaskResultValue
impl Clone for TaskResultValue
Source§fn clone(&self) -> TaskResultValue
fn clone(&self) -> TaskResultValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TaskResultValue
impl RefUnwindSafe for TaskResultValue
impl Send for TaskResultValue
impl Sync for TaskResultValue
impl Unpin for TaskResultValue
impl UnwindSafe for TaskResultValue
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