pub struct Graph { /* private fields */ }Expand description
图(Graph)— 允许有环,循环保护由 GraphExecutor::max_steps 运行时熔断提供。
Implementations§
Source§impl Graph
impl Graph
pub fn node_names(&self) -> Vec<&str>
pub fn start_node(&self) -> &str
pub fn end_node(&self) -> &str
pub fn edges_from(&self, from: &str) -> Vec<&Edge>
pub fn find_edge(&self, from: &str, to: &str) -> Option<&Edge>
Sourcepub fn find_fallback_edge(&self, from: &str) -> Option<String>
pub fn find_fallback_edge(&self, from: &str) -> Option<String>
查找指定节点的 fallback 边目标。
用于 RecoverableError 恢复:当边级 policy 触发 SoftFallback 时, 寻找 fallback 边作为降级路径。
Sourcepub fn validate(&self) -> Result<(), TerminalError>
pub fn validate(&self) -> Result<(), TerminalError>
验证图结构(节点、边引用有效性)。
注意:不检测环 — 有环图是合法的,循环保护由 GraphExecutor::max_steps 提供。
Sourcepub fn analyze_cycles(&self) -> CycleAnalysis
pub fn analyze_cycles(&self) -> CycleAnalysis
分析图中所有环,生成诊断信息。
Auto Trait Implementations§
impl !RefUnwindSafe for Graph
impl !UnwindSafe for Graph
impl Freeze for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
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