pub enum Node {
Step {
ref_: String,
in_: Expr,
out: Expr,
},
Seq {
children: Vec<Node>,
},
Branch {
cond: Expr,
then_: Box<Node>,
else_: Box<Node>,
},
Fanout {
items: Expr,
bind: Expr,
body: Box<Node>,
join: JoinMode,
out: Expr,
},
Loop {
counter: Expr,
cond: Expr,
body: Box<Node>,
max: u32,
},
Try {
body: Box<Node>,
catch: Box<Node>,
err_at: Option<Expr>,
},
Assign {
at: Expr,
value: Expr,
},
}Expand description
flow.ir Node kind.
Discriminated with kind tag, deny_unknown_fields (open=false),
rename_all = "snake_case". Covers the 7 supported kinds: Step / Seq
/ Branch / Fanout (canonical schema の fanout Node、 4 join mode) /
Loop / Try / Assign. Additional kinds may be added in future
versions.
Variants§
Step
Step — dispatch a referenced operation with in input, write result to out.
Fields
ref_: StringDispatcher key (wire field ref), resolved via Dispatcher::dispatch.
Seq
Seq — evaluate children in order, threading the context value through.
Branch
Branch — eval cond; if true run then, else run else.
Fields
Fanout
Fanout — eval items to an array, run body per item against a
branch-local ctx (caller ctx + item written to bind), join results
per join mode into out. Async parallel runner uses
futures::future::{try_join_all|select_ok|join_all} (executor-agnostic).
Fields
Loop
Loop — counter を 0 から、 cond が truthy かつ counter < max の間
body を eval。 各 iter 後 counter を increment して counter path に書く。
VerdictLoop 等の retry/poll パターン primitive (canonical schema 整合)。
Fields
Try
Try — body を eval、 raise した場合 catch を eval。
err_at が Some なら catch 開始前に error message を ctx に書く。
Fields
Assign
Assign — pure transform Node。 value Expr を ctx snapshot 上で評価し、
結果を at (Path Expr) に write する。 dispatcher 不要、 副作用は
CtxStorage.write 1 回のみ。 Seq の中で Step 間の Adhoc update 表現に
使う (= IR primitive、 Command 履歴は CtxStorage の write hook 経由で取得)。
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Node, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Node, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Node
impl Serialize for Node
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Node
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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 more