Bring more functions into modules in plugins via rhai_fn(name) attribute.
This commit is contained in:
@@ -5,14 +5,14 @@ use crate::plugin::*;
|
||||
#[cfg(not(feature = "no_object"))]
|
||||
use crate::engine::make_getter;
|
||||
|
||||
#[export_fn]
|
||||
fn get_fn_name(f: &mut FnPtr) -> ImmutableString {
|
||||
f.get_fn_name().clone()
|
||||
}
|
||||
|
||||
def_package!(crate:BasicFnPackage:"Basic Fn functions.", lib, {
|
||||
set_exported_fn!(lib, "name", get_fn_name);
|
||||
|
||||
#[cfg(not(feature = "no_object"))]
|
||||
set_exported_fn!(lib, make_getter("name"), get_fn_name);
|
||||
});
|
||||
|
||||
#[export_fn]
|
||||
fn get_fn_name(f: &mut FnPtr) -> ImmutableString {
|
||||
f.get_fn_name().clone()
|
||||
}
|
||||
|
Reference in New Issue
Block a user