pub struct ConditionNode {
pub name: String,
pub branches: Vec<(String, BranchCondition)>,
}Expand description
条件分支节点。
按声明顺序求值分支条件,返回第一个匹配分支的 NextStep::Goto(target)。
无匹配时返回 NextStep::GoToNext,由 Graph 层的 edge_fallback 处理兜底路由。
Fields§
§name: String§branches: Vec<(String, BranchCondition)>Implementations§
Source§impl ConditionNode
impl ConditionNode
pub fn builder(name: impl Into<String>) -> ConditionNodeBuilder
Trait Implementations§
Source§impl Clone for ConditionNode
impl Clone for ConditionNode
Source§fn clone(&self) -> ConditionNode
fn clone(&self) -> ConditionNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl FlowNode for ConditionNode
impl FlowNode for ConditionNode
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 State,
) -> Pin<Box<dyn Future<Output = Result<NodeOutput, GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 State,
) -> Pin<Box<dyn Future<Output = Result<NodeOutput, GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行节点逻辑(阻塞模式)。 Read more
Source§fn metadata_hint(&self) -> NodeMetadata
fn metadata_hint(&self) -> NodeMetadata
节点元数据提示 — 静态声明节点的执行特征。 Read more
Source§fn execute_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 State,
_sink: &'life2 Sender<GraphEvent>,
span_id: SpanId,
) -> Pin<Box<dyn Future<Output = Result<StreamNodeResult, GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 State,
_sink: &'life2 Sender<GraphEvent>,
span_id: SpanId,
) -> Pin<Box<dyn Future<Output = Result<StreamNodeResult, GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
执行节点逻辑(流式模式),将内部事件转发到 channel。 Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ConditionNode
impl !UnwindSafe for ConditionNode
impl Freeze for ConditionNode
impl Send for ConditionNode
impl Sync for ConditionNode
impl Unpin for ConditionNode
impl UnsafeUnpin for ConditionNode
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