pub enum ILExpression {
Literal(Value),
Variable {
var_ref: u32,
},
Plan {
plan: ILPlan,
},
Bind {
bind: BindExpression,
},
If {
if_expr: Box<IfExpression>,
},
Get {
get: GetExpression,
},
Call {
call: CallExpression,
},
MapOp {
map: MapExpression,
},
FilterOp {
filter: FilterExpression,
},
ReduceOp {
reduce: ReduceExpression,
},
}
Expand description
Extended IL expressions for complete Cap’n Web protocol support Includes variable references, bindings, conditionals, and plans
Variants§
Literal(Value)
Direct JSON value
Variable
Variable reference: [“var”, index]
Plan
Plan execution: [“plan”, …operations]
Bind
Variable binding: [“bind”, value, body]
Fields
§
bind: BindExpression
If
Conditional: [“if”, condition, then_expr, else_expr]
Fields
§
if_expr: Box<IfExpression>
Get
Property access: [“get”, object, property]
Fields
§
get: GetExpression
Call
Function call: [“call”, target, method, …args]
Fields
§
call: CallExpression
MapOp
Array map operation: [“map”, array, function]
Fields
§
map: MapExpression
FilterOp
Filter operation: [“filter”, array, predicate]
Fields
§
filter: FilterExpression
ReduceOp
Reduce operation: [“reduce”, array, function, initial]
Fields
§
reduce: ReduceExpression
Implementations§
Source§impl ILExpression
impl ILExpression
Sourcepub fn bind(value: ILExpression, body: ILExpression) -> Self
pub fn bind(value: ILExpression, body: ILExpression) -> Self
Create a bind expression
Sourcepub fn if_expr(
condition: ILExpression,
then_branch: ILExpression,
else_branch: ILExpression,
) -> Self
pub fn if_expr( condition: ILExpression, then_branch: ILExpression, else_branch: ILExpression, ) -> Self
Create an if expression
Sourcepub fn get(object: ILExpression, property: String) -> Self
pub fn get(object: ILExpression, property: String) -> Self
Create a property get expression
Sourcepub fn call(
target: ILExpression,
method: String,
args: Vec<ILExpression>,
) -> Self
pub fn call( target: ILExpression, method: String, args: Vec<ILExpression>, ) -> Self
Create a method call expression
Sourcepub fn map(array: ILExpression, function: ILExpression) -> Self
pub fn map(array: ILExpression, function: ILExpression) -> Self
Create a map expression for array transformation
Trait Implementations§
Source§impl Clone for ILExpression
impl Clone for ILExpression
Source§fn clone(&self) -> ILExpression
fn clone(&self) -> ILExpression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ILExpression
impl Debug for ILExpression
Source§impl<'de> Deserialize<'de> for ILExpression
impl<'de> Deserialize<'de> for ILExpression
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ILExpression
impl PartialEq for ILExpression
Source§impl Serialize for ILExpression
impl Serialize for ILExpression
impl StructuralPartialEq for ILExpression
Auto Trait Implementations§
impl Freeze for ILExpression
impl RefUnwindSafe for ILExpression
impl Send for ILExpression
impl Sync for ILExpression
impl Unpin for ILExpression
impl UnwindSafe for ILExpression
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