Skip to main content

ExecutableAsyncUpdate

Trait ExecutableAsyncUpdate 

Source
pub trait ExecutableAsyncUpdate<U>: WorkflowImplementation{
    // Required method
    fn handle(
        ctx: WorkflowContext<Self>,
        input: <U as UpdateDefinition>::Input,
    ) -> Pin<Box<dyn Future<Output = Result<<U as UpdateDefinition>::Output, Box<dyn Error + Sync + Send>>>>>;

    // Provided methods
    fn validate(
        &self,
        _ctx: &WorkflowContextView,
        _input: &<U as UpdateDefinition>::Input,
    ) -> Result<(), Box<dyn Error + Sync + Send>> { ... }
    fn dispatch(
        ctx: WorkflowContext<Self>,
        input: Box<dyn Any>,
        converter: &PayloadConverter,
    ) -> Pin<Box<dyn Future<Output = Result<Payload, WorkflowError>>>> { ... }
    fn dispatch_validate(
        &self,
        ctx: &WorkflowContextView,
        input: Box<dyn Any>,
    ) -> Result<(), WorkflowError> { ... }
}
Expand description

Trait for executing asynchronous update handlers on a workflow.

Required Methods§

Source

fn handle( ctx: WorkflowContext<Self>, input: <U as UpdateDefinition>::Input, ) -> Pin<Box<dyn Future<Output = Result<<U as UpdateDefinition>::Output, Box<dyn Error + Sync + Send>>>>>

Handle an update with the given input and return the result.

Provided Methods§

Source

fn validate( &self, _ctx: &WorkflowContextView, _input: &<U as UpdateDefinition>::Input, ) -> Result<(), Box<dyn Error + Sync + Send>>

Validate an update before it is applied.

Source

fn dispatch( ctx: WorkflowContext<Self>, input: Box<dyn Any>, converter: &PayloadConverter, ) -> Pin<Box<dyn Future<Output = Result<Payload, WorkflowError>>>>

Dispatch the update with an already decoded input.

Source

fn dispatch_validate( &self, ctx: &WorkflowContextView, input: Box<dyn Any>, ) -> Result<(), WorkflowError>

Dispatch validation with an already decoded input.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§