Skip to main content

WorkflowDriver

Trait WorkflowDriver 

Source
pub trait WorkflowDriver<Context>: Send + Sync
where 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; // Provided method fn supports_revision(&self, _item: &WorkItem) -> bool { ... } }
Expand description

Deterministic evaluator for the specs it owns.

Required Methods§

Source

fn name(&self) -> &'static str

Stable driver name.

Source

fn spec_ids(&self) -> Vec<&str>

Specs this driver owns.

Source

fn validate_specs(&self) -> Result<(), String>

Reject a spec set the driver cannot serve; the reason is reported as SupervisorError::Driver.

Source

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.

Provided Methods§

Source

fn supports_revision(&self, _item: &WorkItem) -> bool

Explicitly admit the exact revision and ABI a custom driver implements. The default refuses execution rather than silently accepting new revisions.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Context: Send + Sync> WorkflowDriver<Context> for SpecDriver