pub trait QueryService: Send + Sync {
// Required method
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
target: &'life1 WorkflowHandle,
name: String,
arguments: Payload,
) -> Pin<Box<dyn Future<Output = Result<Payload, EngineError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
AT-007 query-dispatch seam.
Implementations dispatch a read-only query to workflow code and map their
query errors into EngineError. The engine only resolves the live target
handle and delegates to this trait.
Required Methods§
Sourcefn query<'life0, 'life1, 'async_trait>(
&'life0 self,
target: &'life1 WorkflowHandle,
name: String,
arguments: Payload,
) -> Pin<Box<dyn Future<Output = Result<Payload, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
target: &'life1 WorkflowHandle,
name: String,
arguments: Payload,
) -> Pin<Box<dyn Future<Output = Result<Payload, EngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dispatch a named query, with its caller-supplied arguments, to the already-resolved workflow target.
arguments is a type-erased Payload carrying the JSON document the
workflow’s query handler decodes. null is the canonical “no
arguments” document. Arguments are read-only inputs: they are handed to
the handler and never recorded.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".