pub struct TaskResult {
pub task_id: String,
pub workflow_instance_id: String,
pub worker_id: Option<String>,
pub status: TaskResultStatus,
pub output_data: HashMap<String, Value>,
pub reason_for_incompletion: Option<String>,
pub callback_after_seconds: i64,
pub logs: Vec<TaskExecLog>,
pub external_output_payload_storage_path: Option<String>,
pub sub_workflow_id: Option<String>,
pub extend_lease: bool,
}Expand description
Result of a task execution.
Fields§
§task_id: StringTask ID.
workflow_instance_id: StringWorkflow instance ID.
worker_id: Option<String>Worker ID that executed the task.
status: TaskResultStatusTask execution status.
output_data: HashMap<String, Value>Output data from the task.
reason_for_incompletion: Option<String>Reason for failure (if failed).
callback_after_seconds: i64Callback after seconds (for IN_PROGRESS tasks).
logs: Vec<TaskExecLog>Logs from task execution.
external_output_payload_storage_path: Option<String>External output payload storage path.
sub_workflow_id: Option<String>Subworkflow ID (for subworkflow tasks).
extend_lease: boolExtend lease (keep-alive for long-running tasks).
Implementations§
Source§impl TaskResult
impl TaskResult
Sourcepub fn completed(
task_id: impl Into<String>,
workflow_instance_id: impl Into<String>,
) -> Self
pub fn completed( task_id: impl Into<String>, workflow_instance_id: impl Into<String>, ) -> Self
Create a new completed task result.
Sourcepub fn failed(
task_id: impl Into<String>,
workflow_instance_id: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn failed( task_id: impl Into<String>, workflow_instance_id: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a new failed task result.
Sourcepub fn in_progress(
task_id: impl Into<String>,
workflow_instance_id: impl Into<String>,
callback_after_seconds: i64,
) -> Self
pub fn in_progress( task_id: impl Into<String>, workflow_instance_id: impl Into<String>, callback_after_seconds: i64, ) -> Self
Create an in-progress task result (for long-running tasks).
Sourcepub fn with_worker_id(self, worker_id: impl Into<String>) -> Self
pub fn with_worker_id(self, worker_id: impl Into<String>) -> Self
Set worker ID.
Sourcepub fn with_output(self, output: HashMap<String, Value>) -> Self
pub fn with_output(self, output: HashMap<String, Value>) -> Self
Set output data.
Sourcepub fn with_output_value(
self,
key: impl Into<String>,
value: impl Serialize,
) -> Self
pub fn with_output_value( self, key: impl Into<String>, value: impl Serialize, ) -> Self
Set a single output value.
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
Set failure reason.
Sourcepub fn with_extend_lease(self, extend: bool) -> Self
pub fn with_extend_lease(self, extend: bool) -> Self
Extend the lease (for long-running tasks).
Trait Implementations§
Source§impl Clone for TaskResult
impl Clone for TaskResult
Source§impl Debug for TaskResult
impl Debug for TaskResult
Source§impl Default for TaskResult
impl Default for TaskResult
Source§impl<'de> Deserialize<'de> for TaskResult
impl<'de> Deserialize<'de> for TaskResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TaskResult
impl RefUnwindSafe for TaskResult
impl Send for TaskResult
impl Sync for TaskResult
impl Unpin for TaskResult
impl UnsafeUnpin for TaskResult
impl UnwindSafe for TaskResult
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