pub struct DurableExecutionInvocationOutput {
pub status: InvocationStatus,
pub result: Option<String>,
pub error: Option<ErrorObject>,
}Expand description
Output payload for a durable execution Lambda invocation.
This struct is serialized and returned from the Lambda function to indicate the execution status.
Fields§
§status: InvocationStatusThe status of the invocation
result: Option<String>The serialized result if the execution succeeded
error: Option<ErrorObject>Error details if the execution failed
Implementations§
Source§impl DurableExecutionInvocationOutput
impl DurableExecutionInvocationOutput
Sourcepub const MAX_RESPONSE_SIZE: usize
pub const MAX_RESPONSE_SIZE: usize
Maximum response size in bytes (6MB Lambda limit)
Sourcepub fn succeeded(result: Option<String>) -> Self
pub fn succeeded(result: Option<String>) -> Self
Creates a new output indicating successful completion.
Sourcepub fn failed(error: ErrorObject) -> Self
pub fn failed(error: ErrorObject) -> Self
Creates a new output indicating failure.
Sourcepub fn is_succeeded(&self) -> bool
pub fn is_succeeded(&self) -> bool
Returns true if the invocation succeeded.
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Returns true if the invocation is pending.
Sourcepub fn from_result<T: Serialize>(result: &T) -> Self
pub fn from_result<T: Serialize>(result: &T) -> Self
Creates an output from a serializable result.
This method handles:
- Serializing the result to JSON
- Checking if the response exceeds the maximum size
- Returning appropriate error if serialization fails
§Arguments
result- The result to serialize
§Returns
A DurableExecutionInvocationOutput with:
SUCCEEDEDstatus if serialization succeeds and size is within limitsFAILEDstatus if serialization fails or response is too large
Sourcepub fn from_error(error: &DurableError) -> Self
pub fn from_error(error: &DurableError) -> Self
Sourcepub fn would_exceed_max_size<T: Serialize>(result: &T) -> bool
pub fn would_exceed_max_size<T: Serialize>(result: &T) -> bool
Sourcepub fn checkpointed_result(checkpoint_id: &str, original_size: usize) -> Self
pub fn checkpointed_result(checkpoint_id: &str, original_size: usize) -> Self
Creates an output for a large result that has been checkpointed.
This method creates a SUCCEEDED output with a reference to the checkpointed result, rather than the result itself.
§Arguments
checkpoint_id- The operation ID where the result was checkpointedoriginal_size- The size of the original serialized result in bytes
§Returns
A DurableExecutionInvocationOutput with SUCCEEDED status and a reference
to the checkpointed result.
Sourcepub fn is_checkpointed_result(&self) -> bool
pub fn is_checkpointed_result(&self) -> bool
Checks if this output represents a checkpointed large result.
§Returns
true if this output contains a reference to a checkpointed result
Trait Implementations§
Source§impl Clone for DurableExecutionInvocationOutput
impl Clone for DurableExecutionInvocationOutput
Source§fn clone(&self) -> DurableExecutionInvocationOutput
fn clone(&self) -> DurableExecutionInvocationOutput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl From<Result<Option<String>, ErrorObject>> for DurableExecutionInvocationOutput
impl From<Result<Option<String>, ErrorObject>> for DurableExecutionInvocationOutput
Auto Trait Implementations§
impl Freeze for DurableExecutionInvocationOutput
impl RefUnwindSafe for DurableExecutionInvocationOutput
impl Send for DurableExecutionInvocationOutput
impl Sync for DurableExecutionInvocationOutput
impl Unpin for DurableExecutionInvocationOutput
impl UnsafeUnpin for DurableExecutionInvocationOutput
impl UnwindSafe for DurableExecutionInvocationOutput
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<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 more