ForgeWorkflow

Trait ForgeWorkflow 

Source
pub trait ForgeWorkflow:
    Send
    + Sync
    + 'static {
    type Input: DeserializeOwned + Serialize + Send + Sync;
    type Output: Serialize + Send;

    // Required methods
    fn info() -> WorkflowInfo;
    fn execute(
        ctx: &WorkflowContext,
        input: Self::Input,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, ForgeError>> + Send + '_>>;
}
Expand description

Trait for workflow handlers.

Required Associated Types§

Source

type Input: DeserializeOwned + Serialize + Send + Sync

Input type for the workflow.

Source

type Output: Serialize + Send

Output type for the workflow.

Required Methods§

Source

fn info() -> WorkflowInfo

Get workflow metadata.

Source

fn execute( ctx: &WorkflowContext, input: Self::Input, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, ForgeError>> + Send + '_>>

Execute the workflow.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§