Closed ysimonson closed 5 years ago
Maybe useful enough to bring in? I've been using this macro to define foreign functions from closures.
A couple of examples:
ketos_closure!(scope, "pid", || -> u32 { Ok(process::id()) }); ketos_closure!(scope, "setenv", |key: &str, value: &str| -> () { env::set_var(key, value); Ok(()) });
Looks great. Thanks!
Maybe useful enough to bring in? I've been using this macro to define foreign functions from closures.
A couple of examples: