pub enum Expr {
LitInt(i64),
LitStr(String),
LitBool(bool),
State(String),
Capture(String),
Arg(String),
Bin {
op: BinOp,
l: Box<Expr>,
r: Box<Expr>,
},
Not(Box<Expr>),
Call {
name: String,
args: Vec<Expr>,
},
Field {
base: Box<Expr>,
name: String,
},
RecLit {
ty: String,
fields: Vec<(String, Expr)>,
},
}Expand description
§35: expression language for set — pure functions over session
state and the triggering event’s fields. No I/O, no clock: the only
effects a program can cause are speech acts (§35.6).
Variants§
LitInt(i64)
LitStr(String)
LitBool(bool)
State(String)
Capture(String)
§38.3: capture reference $p — resolves to the value captured by
the trigger’s pattern. Captures shadow session states.
Arg(String)
arg.price — field of the triggering event’s structured payload
Bin
Not(Box<Expr>)
Call
builtin pure functions: add sub mul div min max len sum count concat upper lower str int exists abs — plus user-defined §38.1 functions (resolved after builtins)
Field
§38.2: field access on records: last_quote.price
RecLit
§38.2: record literal: make(Quote, price: 5, currency: "usd")
(parsed via Call when the callee names a declared type)
Implementations§
Trait Implementations§
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
Mutably borrows from an owned value. Read more