pub trait ExecutableQuery<Q>: WorkflowImplementationwhere
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>,
) -> Result<Box<dyn WorkflowOutputValue>, WorkflowError> { ... }
}Expand description
Trait for executing query handlers on a workflow.
Required Methods§
Sourcefn handle(
&self,
ctx: &WorkflowContextView,
input: <Q as QueryDefinition>::Input,
) -> Result<<Q as QueryDefinition>::Output, Box<dyn Error + Sync + Send>>
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§
Sourcefn dispatch(
&self,
ctx: &WorkflowContextView,
input: Box<dyn Any>,
) -> Result<Box<dyn WorkflowOutputValue>, WorkflowError>
fn dispatch( &self, ctx: &WorkflowContextView, input: Box<dyn Any>, ) -> Result<Box<dyn WorkflowOutputValue>, 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".