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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Expr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Expr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Expr
impl Serialize for Expr
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 Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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