Skip to main content

ExecutableQuery

Trait ExecutableQuery 

Source
pub trait ExecutableQuery<Q>: WorkflowImplementation
where Q: QueryDefinition,
{ // Required method fn handle( &self, ctx: &WorkflowContextView, input: <Q as QueryDefinition>::Input, ) -> Result<<Q as QueryDefinition>::Output, Box<dyn Error + Sync + Send>>; // Provided method fn dispatch( &self, ctx: &WorkflowContextView, input: Box<dyn Any>, converter: &PayloadConverter, ) -> Result<Payload, WorkflowError> { ... } }
Expand description

Trait for executing query handlers on a workflow.

Required Methods§

Source

fn handle( &self, ctx: &WorkflowContextView, input: <Q as QueryDefinition>::Input, ) -> Result<<Q as QueryDefinition>::Output, Box<dyn Error + Sync + Send>>

Handle a query with the given input and return the result.

Provided Methods§

Source

fn dispatch( &self, ctx: &WorkflowContextView, input: Box<dyn Any>, converter: &PayloadConverter, ) -> Result<Payload, WorkflowError>

Dispatch the query 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§