#[repr(u8)]pub enum OperationStatus {
Started = 0,
Pending = 1,
Ready = 2,
Succeeded = 3,
Failed = 4,
Cancelled = 5,
TimedOut = 6,
Stopped = 7,
}Expand description
The status of an operation in a durable execution.
This enum uses #[repr(u8)] for compact memory representation (1 byte).
Explicit discriminant values ensure stability across versions.
§Examples
use durable_execution_sdk::operation::OperationStatus;
let succeeded = OperationStatus::Succeeded;
let pending = OperationStatus::Pending;
// Check terminal status
assert!(succeeded.is_terminal());
assert!(!pending.is_terminal());
// Check success/failure
assert!(succeeded.is_success());
assert!(!succeeded.is_failure());
// Serialization uses uppercase names
let json = serde_json::to_string(&succeeded).unwrap();
assert_eq!(json, "\"SUCCEEDED\"");Variants§
Started = 0
Operation has started but not completed
Pending = 1
Operation is pending (e.g., step waiting for retry) Requirements: 3.7, 4.7
Ready = 2
Operation is ready to resume execution (e.g., after retry delay) Requirements: 3.7, 4.7
Succeeded = 3
Operation completed successfully
Failed = 4
Operation failed with an error
Cancelled = 5
Operation was cancelled
TimedOut = 6
Operation timed out
Stopped = 7
Operation was stopped externally
Implementations§
Source§impl OperationStatus
impl OperationStatus
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true if this status represents a terminal state.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if this status represents a successful completion.
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Returns true if this status represents a failure.
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Returns true if this status indicates the operation is pending (waiting for retry). Requirements: 3.7, 4.7
Sourcepub fn is_ready(&self) -> bool
pub fn is_ready(&self) -> bool
Returns true if this status indicates the operation is ready to resume. Requirements: 3.7, 4.7
Sourcepub fn is_resumable(&self) -> bool
pub fn is_resumable(&self) -> bool
Returns true if this status indicates the operation can be resumed. This includes both PENDING and READY statuses. Requirements: 3.7
Trait Implementations§
Source§impl Clone for OperationStatus
impl Clone for OperationStatus
Source§fn clone(&self) -> OperationStatus
fn clone(&self) -> OperationStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OperationStatus
impl Debug for OperationStatus
Source§impl<'de> Deserialize<'de> for OperationStatus
impl<'de> Deserialize<'de> for OperationStatus
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OperationStatus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OperationStatus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for OperationStatus
impl Display for OperationStatus
Source§impl PartialEq for OperationStatus
impl PartialEq for OperationStatus
Source§impl Serialize for OperationStatus
impl Serialize for OperationStatus
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for OperationStatus
impl Eq for OperationStatus
impl StructuralPartialEq for OperationStatus
Auto Trait Implementations§
impl Freeze for OperationStatus
impl RefUnwindSafe for OperationStatus
impl Send for OperationStatus
impl Sync for OperationStatus
impl Unpin for OperationStatus
impl UnsafeUnpin for OperationStatus
impl UnwindSafe for OperationStatus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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 moreSource§impl<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
impl<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
Source§fn into_response(self) -> FunctionResponse<B, Body>
fn into_response(self) -> FunctionResponse<B, Body>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.