Custom expression function, automatically bound to js context#374
Custom expression function, automatically bound to js context#374Cassielxd wants to merge 4 commits intogorules:masterfrom
Conversation
|
Hi, could you give more context into what this PR does? |
|
My scenario is to use it in the pricing software of the construction industry. I need to customize business-related functions and use them in the expression engine. In the current business, if all metadata are passed in as requests, a lot of serialization is required. Therefore, a separate state mechanism is designed, which is only used in custom functions and the state will be released after execution. |
|
use zen_expression::{Isolate, Variable}; // 1. 定义一个简单的、我们自己的状态 impl MyState { } fn main() -> anyhow::Result<()> { } |
|
Registration is complete and is bound to the js context use std::future::Future; pub struct ModuforgeListener { impl RuntimeListener for ModuforgeListener { } pub struct ModuforgeModule; impl ModuleDef for ModuforgeModule { } |
Custom expression function, automatically bound to js context