pub struct WorkflowGraph {
pub id: String,
pub name: String,
pub description: String,
/* private fields */
}Expand description
工作流图
Fields§
§id: String图 ID
name: String图名称
description: String图描述
Implementations§
Source§impl WorkflowGraph
impl WorkflowGraph
pub fn new(id: &str, name: &str) -> WorkflowGraph
pub fn with_description(self, desc: &str) -> WorkflowGraph
Sourcepub fn add_node(&mut self, node: WorkflowNode) -> &mut WorkflowGraph
pub fn add_node(&mut self, node: WorkflowNode) -> &mut WorkflowGraph
添加节点
Sourcepub fn add_edge(&mut self, edge: EdgeConfig) -> &mut WorkflowGraph
pub fn add_edge(&mut self, edge: EdgeConfig) -> &mut WorkflowGraph
添加边
Sourcepub fn connect(&mut self, from: &str, to: &str) -> &mut WorkflowGraph
pub fn connect(&mut self, from: &str, to: &str) -> &mut WorkflowGraph
添加普通边
Sourcepub fn connect_conditional(
&mut self,
from: &str,
to: &str,
condition: &str,
) -> &mut WorkflowGraph
pub fn connect_conditional( &mut self, from: &str, to: &str, condition: &str, ) -> &mut WorkflowGraph
添加条件边
Sourcepub fn get_node(&self, node_id: &str) -> Option<&WorkflowNode>
pub fn get_node(&self, node_id: &str) -> Option<&WorkflowNode>
获取节点
Sourcepub fn get_node_mut(&mut self, node_id: &str) -> Option<&mut WorkflowNode>
pub fn get_node_mut(&mut self, node_id: &str) -> Option<&mut WorkflowNode>
获取可变节点
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
获取节点数量
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
获取边数量
Sourcepub fn start_node(&self) -> Option<&str>
pub fn start_node(&self) -> Option<&str>
获取开始节点
Sourcepub fn get_outgoing_edges(&self, node_id: &str) -> &[EdgeConfig]
pub fn get_outgoing_edges(&self, node_id: &str) -> &[EdgeConfig]
获取节点的出边
Sourcepub fn get_incoming_edges(&self, node_id: &str) -> &[EdgeConfig]
pub fn get_incoming_edges(&self, node_id: &str) -> &[EdgeConfig]
获取节点的入边
Sourcepub fn get_successors(&self, node_id: &str) -> Vec<&str>
pub fn get_successors(&self, node_id: &str) -> Vec<&str>
获取节点的后继节点
Sourcepub fn get_predecessors(&self, node_id: &str) -> Vec<&str>
pub fn get_predecessors(&self, node_id: &str) -> Vec<&str>
获取节点的前驱节点
Sourcepub fn get_next_node(
&self,
node_id: &str,
condition: Option<&str>,
) -> Option<&str>
pub fn get_next_node( &self, node_id: &str, condition: Option<&str>, ) -> Option<&str>
获取满足条件的下一个节点
Sourcepub fn get_error_handler(&self, node_id: &str) -> Option<&str>
pub fn get_error_handler(&self, node_id: &str) -> Option<&str>
获取错误处理节点
Sourcepub fn get_parallel_groups(&self) -> Vec<Vec<String>>
pub fn get_parallel_groups(&self) -> Vec<Vec<String>>
获取可以并行执行的节点组
Auto Trait Implementations§
impl Freeze for WorkflowGraph
impl !RefUnwindSafe for WorkflowGraph
impl Send for WorkflowGraph
impl Sync for WorkflowGraph
impl Unpin for WorkflowGraph
impl UnsafeUnpin for WorkflowGraph
impl !UnwindSafe for WorkflowGraph
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage