Trait rhai::RegisterNativeFunction
source · [−]pub trait RegisterNativeFunction<ARGS, RET, RESULT> {
fn into_callable_function(self) -> CallableFunction;
fn param_types() -> Box<[TypeId]>;
fn param_names() -> Box<[&'static str]>;
fn return_type() -> TypeId;
fn return_type_name() -> &'static str;
}
Expand description
Trait to register custom Rust functions.
Type Parameters
ARGS
- a tuple containing parameter types, with&mut T
represented byMut<T>
.RET
- return type of the function; if the function returnsResult
, it is the unwrapped inner value type.
Required Methods
sourcefn into_callable_function(self) -> CallableFunction
fn into_callable_function(self) -> CallableFunction
Convert this function into a CallableFunction
.
sourcefn param_types() -> Box<[TypeId]>
fn param_types() -> Box<[TypeId]>
Get the type ID’s of this function’s parameters.
sourcefn param_names() -> Box<[&'static str]>
fn param_names() -> Box<[&'static str]>
(metadata) Get the type names of this function’s parameters.
Exported under the metadata
feature only.
sourcefn return_type() -> TypeId
fn return_type() -> TypeId
(metadata) Get the type ID of this function’s return value.
Exported under the metadata
feature only.
sourcefn return_type_name() -> &'static str
fn return_type_name() -> &'static str
(metadata) Get the type name of this function’s return value.
Exported under the metadata
feature only.