pub struct Node {
pub id: String,
pub name: String,
pub node_type: String,
pub config: Value,
pub dependencies: Vec<String>,
pub timeout_ms: u64,
pub retry_count: u32,
}Expand description
工作流节点
Fields§
§id: String节点 ID
name: String节点名称
node_type: String节点类型
config: Value节点配置
dependencies: Vec<String>依赖的节点 ID
timeout_ms: u64超时时间(毫秒)
retry_count: u32重试次数
Implementations§
Source§impl Node
impl Node
Sourcepub fn with_config(self, config: Value) -> Self
pub fn with_config(self, config: Value) -> Self
设置配置
Sourcepub fn depends_on(self, node_id: &str) -> Self
pub fn depends_on(self, node_id: &str) -> Self
添加依赖
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
设置超时
Sourcepub fn with_retry(self, retry_count: u32) -> Self
pub fn with_retry(self, retry_count: u32) -> Self
设置重试次数
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
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 Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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