pub trait IntoScriptFn<Marker> {
// Required method
fn into_script_fn_parts(self) -> (Vec<ScriptTy>, ScriptTy, ScriptFnBody);
}Expand description
Adapts a plain Rust closure into the body and signature of a ScriptFn.
The Marker parameter disambiguates the per-arity impls, the same trick
Rhai and Bevy use so one entry point accepts closures of many shapes without
a type annotation. Arity runs to MAX_VARIADIC_ARITY; past that, describe
the function with ScriptFn::new.
Required Methods§
Sourcefn into_script_fn_parts(self) -> (Vec<ScriptTy>, ScriptTy, ScriptFnBody)
fn into_script_fn_parts(self) -> (Vec<ScriptTy>, ScriptTy, ScriptFnBody)
The declared parameter types, the declared return type, and the body.
Driven by ScriptFn::from_fn; not meant to be called directly.