[−][src]Function glsp_engine::bind_rfn
pub fn bind_rfn<S: ToSym, ArgsWithTag, Ret, F>(name: S, f: F) -> GResult<()> where
Wrapper<ArgsWithTag, Ret, F>: WrappedCall + 'static,
Binds a Rust function to a global variable.
GameLisp will perform automatic conversions for the function's parameters and return
value. See glsp::rfn
and glsp::named_rfn
for the details.
glsp::bind_rfn(name, &f)
is equivalent to:
let sym = name.to_sym()? let rfn = glsp::named_rfn(sym, &f); glsp::bind_global(sym, rfn)