pub struct GraphHandle { /* private fields */ }Expand description
Graph 执行句柄 — 用于与运行中的 Graph 交互。
通过 execute_stream() 返回,消费者使用此句柄提交 Barrier 决策或取消执行。
Implementations§
Source§impl GraphHandle
impl GraphHandle
Sourcepub async fn decide(
&self,
barrier_id: BarrierId,
decision: BarrierDecision,
) -> Result<(), GraphError>
pub async fn decide( &self, barrier_id: BarrierId, decision: BarrierDecision, ) -> Result<(), GraphError>
提交 Barrier 决策(精确匹配)。
barrier_id— 来自GraphEvent::BarrierWaiting的 IDdecision— 审批决策
一次性语义: 每个 BarrierId 只能提交一次决策,重复提交返回错误。
Sourcepub async fn decide_wildcard(
&self,
node_id: impl Into<String>,
decision: BarrierDecision,
) -> Result<(), GraphError>
pub async fn decide_wildcard( &self, node_id: impl Into<String>, decision: BarrierDecision, ) -> Result<(), GraphError>
提交通配决策 — 匹配指定 node_id 的所有 occurrence。
适用于“每次都 Approve“等场景。
ⓘ
handle.decide_wildcard("approve_deploy", BarrierDecision::Approve);
// 匹配 approve_deploy 的所有 occurrenceAuto Trait Implementations§
impl Freeze for GraphHandle
impl RefUnwindSafe for GraphHandle
impl Send for GraphHandle
impl Sync for GraphHandle
impl Unpin for GraphHandle
impl UnsafeUnpin for GraphHandle
impl UnwindSafe for GraphHandle
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