pub trait WorkflowEngineTrait: Send + Sync {
// Required methods
fn add_node(&mut self, node: Node) -> Layer2Result<()>;
fn add_edge(&mut self, from: &str, to: &str) -> Layer2Result<()>;
fn execute<'life0, 'async_trait>(
&'life0 self,
input: WorkflowInput,
) -> Pin<Box<dyn Future<Output = Layer2Result<WorkflowOutput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cancel<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Layer2Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn status(&self, task_id: &TaskId) -> Layer2Result<WorkflowStatus>;
fn validate(&self) -> Layer2Result<Vec<String>>;
fn node_count(&self) -> usize;
fn edge_count(&self) -> usize;
}Expand description
工作流引擎接口
Required Methods§
Sourcefn add_node(&mut self, node: Node) -> Layer2Result<()>
fn add_node(&mut self, node: Node) -> Layer2Result<()>
添加节点
Sourcefn execute<'life0, 'async_trait>(
&'life0 self,
input: WorkflowInput,
) -> Pin<Box<dyn Future<Output = Layer2Result<WorkflowOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
input: WorkflowInput,
) -> Pin<Box<dyn Future<Output = Layer2Result<WorkflowOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
执行工作流
Sourcefn cancel<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Layer2Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cancel<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Layer2Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
取消工作流
Sourcefn status(&self, task_id: &TaskId) -> Layer2Result<WorkflowStatus>
fn status(&self, task_id: &TaskId) -> Layer2Result<WorkflowStatus>
获取工作流状态
Sourcefn validate(&self) -> Layer2Result<Vec<String>>
fn validate(&self) -> Layer2Result<Vec<String>>
验证 DAG 结构
Sourcefn node_count(&self) -> usize
fn node_count(&self) -> usize
获取节点数量
Sourcefn edge_count(&self) -> usize
fn edge_count(&self) -> usize
获取边数量
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".