Skip to main content

lua_fn

Function lua_fn 

Source
pub fn lua_fn<F, A, R>(_f: F) -> LuaFunction
where F: Fn(A) -> R,
Expand description

Coerce a Rust fn item or closure to LuaFunction.

Prefer this for closures (lua_fn(|e| { ... })). Fn items also implement From for LuaFunction directly for common arities.