Static rglua::lua::lua_tocfunction[][src]

pub static lua_tocfunction: Lazy<extern "C" fn(l: LuaState, idx: c_int) -> Option<LuaCFunction>>
Expand description

Converts a value at the given acceptable index to a C function. That value must be a C function; otherwise, returns None.

Example

use rglua::prelude::*;
#[gmod_open]
fn entry(l: LuaState) -> i32 {
	lua_getglobal(l, cstr!("CurTime"));
	let curtime = lua_tocfunction(l, -1).unwrap();
	0
}