Add FnPtr::call_within_context.

This commit is contained in:
Stephen Chung
2021-11-29 12:43:59 +08:00
parent 0ab86ac623
commit ba0a6c667e
8 changed files with 106 additions and 39 deletions

View File

@@ -98,8 +98,8 @@ fn test_functions_global_module() -> Result<(), Box<EvalAltResult>> {
engine.register_result_fn(
"do_stuff",
|context: NativeCallContext, callback: rhai::FnPtr| {
callback.call_dynamic(&context, None, [])
|context: NativeCallContext, callback: rhai::FnPtr| -> Result<INT, _> {
callback.call_within_context(&context, ())
},
);