mlua-rs/rlua

Question: How can I call a Lua callback from Rust?

Closed this issue · 0 comments

Hello,

I'm trying to figuring out, how can I define a callback function for Lua and trigger it from Rust?
I already read the examples and docs, but still, I have no clue!?

For example I want to call this global function in Lua from Rust:

function on_init(arg)
    print(arg)
end

Is this even possible? If so, can you please give ma an example?

Thanks!