pub enum Expr {
Show 20 variants
Path {
at: String,
},
Lit {
value: Value,
},
Eq {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Ne {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Lt {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Lte {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Gt {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Gte {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Not {
arg: Box<Expr>,
},
And {
args: Vec<Expr>,
},
Or {
args: Vec<Expr>,
},
Exists {
arg: Box<Expr>,
},
Add {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Sub {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Mul {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Div {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Mod {
lhs: Box<Expr>,
rhs: Box<Expr>,
},
Len {
arg: Box<Expr>,
},
In {
needle: Box<Expr>,
haystack: Box<Expr>,
},
CallExtern {
ref_: String,
args: Vec<Expr>,
},
}Expand description
flow.ir Expr op.
Discriminated with op tag, deny_unknown_fields, rename_all = "snake_case".
Wire format (op tag / field names) follows the canonical flow-ir-lua
schema (flow/ir/schema.lua) verbatim: gte/lte (not ge/le),
args on and/or, arg on not/len/exists.
Ops:
- read / literal:
Path/Lit - comparison:
Eq/Ne/Lt/Lte/Gt/Gte(numbers or strings) - boolean:
Not/And/Or - existence:
Exists(truthy iffargevaluates to a non-null value) - arithmetic:
Add/Sub/Mul/Div/Mod - aggregate:
Len(length of array / string / object) /In(membership in array) - hatch:
CallExtern(host-registered pure function, resolved viaExterns)
Variants§
Path
Path — read a value from ctx by simple $.a.b.c form.
Lit
Lit — literal JSON value.
Eq
Eq — boolean equality of two sub-expressions.
Ne
Ne — boolean inequality.
Lt
Lt — lhs < rhs. Both numbers (f64) or both strings (lexicographic),
mirroring canonical Lua < semantics. Mixed / other types raise.
Lte
Lte — lhs <= rhs (canonical wire tag lte).
Gt
Gt — lhs > rhs.
Gte
Gte — lhs >= rhs (canonical wire tag gte).
Not
Not — boolean negation of arg (truthy-based; null/false → true).
And
And — variadic boolean conjunction (short-circuit). Empty list → true.
Or
Or — variadic boolean disjunction (short-circuit). Empty list → false.
Exists
Exists — evaluate arg; true iff it resolves to a non-null value.
A Path arg that raises PathNotFound yields false (canonical
arg ~= nil semantics — JSON null maps to Lua nil).
Add
Add — numeric lhs + rhs (f64).
Sub
Sub — numeric lhs - rhs.
Mul
Mul — numeric lhs * rhs.
Div
Div — numeric lhs / rhs. Division by zero raises DispatcherError.
Mod
Mod — numeric lhs % rhs (Lua % semantics: result takes the sign
of rhs). Modulo by zero raises DispatcherError.
Len
Len — length of arg: array → element count, string → char count,
object → key count. Other types raise DispatcherError.
In
In — true if needle equals any element of haystack (which must
evaluate to an array). Rust-side extension (not in canonical schema).
CallExtern
CallExtern — value-shape Hatch: resolve a host-injected pure function
by opaque key via the Externs registry, apply it to evaluated args,
return the value. The registered function MUST be pure (no side
effects, no flow control) — see canonical doc/ir.md §call_extern.