Skip to main content

SerializableContinuation

Enum SerializableContinuation 

Source
pub enum SerializableContinuation {
    Task {
        id: String,
        timeout_ms: Option<u64>,
        retry_policy: Option<RetryPolicy>,
        next: Option<Box<SerializableContinuation>>,
    },
    Fork {
        id: String,
        branches: Vec<SerializableContinuation>,
        join: Option<Box<SerializableContinuation>>,
    },
    Delay {
        id: String,
        duration_ms: u64,
        next: Option<Box<SerializableContinuation>>,
    },
    AwaitSignal {
        id: String,
        signal_name: String,
        timeout_ms: Option<u64>,
        next: Option<Box<SerializableContinuation>>,
    },
}
Expand description

A serializable workflow continuation (stores only IDs and structure).

This type can be serialized/deserialized and later converted back into a runnable WorkflowContinuation using a TaskRegistry.

§Serialization

// Serialize a workflow
let serializable = workflow.continuation().to_serializable();
let json = serde_json::to_string(&serializable)?;

// Deserialize and convert to runnable
let serializable: SerializableContinuation = serde_json::from_str(&json)?;
let continuation = serializable.to_runnable(&registry)?;

Variants§

§

Task

Fields

§timeout_ms: Option<u64>
§retry_policy: Option<RetryPolicy>
§

Fork

§

Delay

Fields

§duration_ms: u64
§

AwaitSignal

Fields

§signal_name: String
§timeout_ms: Option<u64>

Implementations§

Source§

impl SerializableContinuation

Source

pub fn to_runnable( &self, registry: &TaskRegistry, ) -> Result<WorkflowContinuation, WorkflowError>

Convert this serializable continuation into a runnable WorkflowContinuation.

Looks up each task ID in the registry to get the actual implementation.

§Errors

Returns WorkflowError::TaskNotFound if any task ID is not in the registry.

Source

pub fn task_ids(&self) -> Vec<&str>

Get all task IDs referenced in this continuation.

Source

pub fn compute_definition_hash(&self) -> String

Compute a SHA256 hash of this continuation’s structure.

This hash serves as a “version” identifier for the workflow definition. It can be used to detect when a serialized workflow state was created with a different workflow definition than the current one.

The hash is computed from the canonical structure of task IDs and their arrangement.

Trait Implementations§

Source§

impl Clone for SerializableContinuation

Source§

fn clone(&self) -> SerializableContinuation

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SerializableContinuation

Source§

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

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

impl<'de> Deserialize<'de> for SerializableContinuation

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 SerializableContinuation

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,