pub struct ScalarReductionOp {
pub operator: Symbol,
pub literal_cost: u16,
pub literal_apply: fn(&mut Cx, Vec<NumberLiteral>) -> Result<Value>,
pub value_cost: u16,
pub value_apply: fn(&mut Cx, Vec<Value>) -> Result<Value>,
}Expand description
One reduction op in both literal and value form.
Fields§
§operator: SymbolThe operator symbol this op implements (e.g. sum).
literal_cost: u16Dispatch cost of the literal (parsed-form) implementation.
literal_apply: fn(&mut Cx, Vec<NumberLiteral>) -> Result<Value>The literal-form implementation over a vector of number literals.
value_cost: u16Dispatch cost of the value (opaque-object) implementation.
value_apply: fn(&mut Cx, Vec<Value>) -> Result<Value>The value-form implementation over a vector of number values.
Auto Trait Implementations§
impl Freeze for ScalarReductionOp
impl RefUnwindSafe for ScalarReductionOp
impl Send for ScalarReductionOp
impl Sync for ScalarReductionOp
impl Unpin for ScalarReductionOp
impl UnsafeUnpin for ScalarReductionOp
impl UnwindSafe for ScalarReductionOp
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