pub struct NodeDef {Show 14 fields
pub id: String,
pub node_type: NodeType,
pub name: String,
pub description: Option<String>,
pub task: Option<String>,
pub params: HashMap<String, Value>,
pub on_failure: FailureStrategy,
pub timeout_ms: Option<u64>,
pub branches: Option<Vec<BranchDef>>,
pub parallel_branches: Option<Vec<ParallelBranchDef>>,
pub execution_mode: Option<ExecutionMode>,
pub workflow: Option<String>,
pub wait_ms: Option<u64>,
pub approvers: Option<Vec<String>>,
}Expand description
节点定义
Fields§
§id: String节点ID
node_type: NodeType节点类型
name: String节点名称
description: Option<String>节点描述
task: Option<String>任务名称(仅任务节点)
params: HashMap<String, Value>任务参数
on_failure: FailureStrategy失败策略
timeout_ms: Option<u64>超时时间(毫秒)
branches: Option<Vec<BranchDef>>条件分支(仅条件节点)
parallel_branches: Option<Vec<ParallelBranchDef>>并行分支(仅并行节点和流式节点)
execution_mode: Option<ExecutionMode>执行模式(仅并行/流式节点,默认从节点类型推断)
workflow: Option<String>子工作流名称(仅子工作流节点)
wait_ms: Option<u64>等待时间(毫秒,仅等待节点)
approvers: Option<Vec<String>>审批人列表(仅审批节点)
Implementations§
Source§impl NodeDef
impl NodeDef
Sourcepub fn get_execution_mode(&self) -> Option<ExecutionMode>
pub fn get_execution_mode(&self) -> Option<ExecutionMode>
获取节点的执行模式
- 对于 Pipeline 类型节点,返回 Pipeline 模式
- 对于 Parallel 类型节点,返回 Parallel 模式(或自定义模式)
- 其他类型节点返回 None
Sourcepub fn has_barrier(&self) -> bool
pub fn has_barrier(&self) -> bool
是否需要屏障等待
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeDef
impl<'de> Deserialize<'de> for NodeDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NodeDef
impl RefUnwindSafe for NodeDef
impl Send for NodeDef
impl Sync for NodeDef
impl Unpin for NodeDef
impl UnsafeUnpin for NodeDef
impl UnwindSafe for NodeDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more