Enable capacity on packages.

This commit is contained in:
Stephen Chung
2022-09-13 21:47:11 +08:00
parent 257991ca31
commit 85ca6ec4a1
14 changed files with 41 additions and 17 deletions

View File

@@ -7,7 +7,7 @@ use rhai::{def_package, Engine, EvalAltResult, Module, Scope, INT};
fn test_packages() -> Result<(), Box<EvalAltResult>> {
def_package! {
/// My custom package.
MyPackage(m) : SSS {
MyPackage(m @ 32) : SSS {
m.set_native_fn("hello", |x: INT| Ok(x + 1));
m.set_native_fn("@", |x: INT, y: INT| Ok(x * x + y * y));
} |> |engine| {