pub trait WorkflowDriver<Context>: Send + Sync{
// Required methods
fn name(&self) -> &'static str;
fn spec_ids(&self) -> Vec<&str>;
fn validate_specs(&self) -> Result<(), String>;
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 Context,
item: &'life2 WorkItem,
) -> Pin<Box<dyn Future<Output = Result<WorkflowTransitionCommand, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Deterministic evaluator for the specs it owns.
Required Methods§
Sourcefn validate_specs(&self) -> Result<(), String>
fn validate_specs(&self) -> Result<(), String>
Reject a spec set the driver cannot serve; the reason is reported as
SupervisorError::Driver.
Sourcefn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 Context,
item: &'life2 WorkItem,
) -> Pin<Box<dyn Future<Output = Result<WorkflowTransitionCommand, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 Context,
item: &'life2 WorkItem,
) -> Pin<Box<dyn Future<Output = Result<WorkflowTransitionCommand, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Evaluate deterministic workflow state and return one durable command.
External effects must be represented as prepared ActionIntents and
dispatched later by a registered provider.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".