pub trait ExecutableAsyncUpdate<U: UpdateDefinition>: WorkflowImplementation {
// Required method
fn handle(
ctx: WorkflowContext<Self>,
input: U::Input,
) -> LocalBoxFuture<'static, Result<U::Output, Box<dyn Error + Send + Sync>>>;
// Provided methods
fn validate(
&self,
_ctx: &WorkflowContextView,
_input: &U::Input,
) -> Result<(), Box<dyn Error + Send + Sync>> { ... }
fn dispatch(
ctx: WorkflowContext<Self>,
input: Box<dyn Any>,
converter: &PayloadConverter,
) -> LocalBoxFuture<'static, 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§
Provided Methods§
Sourcefn validate(
&self,
_ctx: &WorkflowContextView,
_input: &U::Input,
) -> Result<(), Box<dyn Error + Send + Sync>>
fn validate( &self, _ctx: &WorkflowContextView, _input: &U::Input, ) -> Result<(), Box<dyn Error + Send + Sync>>
Validate an update before it is applied.
Sourcefn dispatch(
ctx: WorkflowContext<Self>,
input: Box<dyn Any>,
converter: &PayloadConverter,
) -> LocalBoxFuture<'static, Result<Payload, WorkflowError>>
fn dispatch( ctx: WorkflowContext<Self>, input: Box<dyn Any>, converter: &PayloadConverter, ) -> LocalBoxFuture<'static, Result<Payload, WorkflowError>>
Dispatch the update with an already decoded input.
Sourcefn dispatch_validate(
&self,
ctx: &WorkflowContextView,
input: Box<dyn Any>,
) -> Result<(), WorkflowError>
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".