rhai/src/packages/fn_basic.rs
2020-09-08 18:01:34 +08:00

17 lines
404 B
Rust

use crate::def_package;
use crate::fn_native::FnPtr;
use crate::plugin::*;
def_package!(crate:BasicFnPackage:"Basic Fn functions.", lib, {
lib.combine_flatten(exported_module!(fn_ptr_functions));
});
#[export_module]
mod fn_ptr_functions {
#[rhai_fn(name = "name", get = "name")]
#[inline(always)]
pub fn name(f: &mut FnPtr) -> ImmutableString {
f.get_fn_name().clone()
}
}