Skip to main content

TaskResult

Struct TaskResult 

Source
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: String

Task ID.

§workflow_instance_id: String

Workflow instance ID.

§worker_id: Option<String>

Worker ID that executed the task.

§status: TaskResultStatus

Task 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: i64

Callback 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: bool

Extend lease (keep-alive for long-running tasks).

Implementations§

Source§

impl TaskResult

Source

pub fn completed( task_id: impl Into<String>, workflow_instance_id: impl Into<String>, ) -> Self

Create a new completed task result.

Source

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.

Source

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).

Source

pub fn with_worker_id(self, worker_id: impl Into<String>) -> Self

Set worker ID.

Source

pub fn with_output(self, output: HashMap<String, Value>) -> Self

Set output data.

Source

pub fn with_output_value( self, key: impl Into<String>, value: impl Serialize, ) -> Self

Set a single output value.

Source

pub fn with_log(self, log: impl Into<String>) -> Self

Add a log entry.

Source

pub fn with_reason(self, reason: impl Into<String>) -> Self

Set failure reason.

Source

pub fn with_extend_lease(self, extend: bool) -> Self

Extend the lease (for long-running tasks).

Trait Implementations§

Source§

impl Clone for TaskResult

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TaskResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TaskResult

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TaskResult

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for TaskResult

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more