-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't save LuaFunction #62
Comments
As an alternative, you could use |
let uart = lua.scope(|scope| {
scope.create_nonstatic_userdata(Uart {
on_message: lua.create_function(|_, msg: String| Ok(()))?,
})
})?; pub fn scope<'lua, 'scope, R, F>(&'lua self, f: F) -> Result<R>
where
'lua: 'scope,
R: 'static,
F: FnOnce<(&Scope<'lua, 'scope>,), Output = Result<R>>, Oh no, |
This is how Scope works - it drops scoped objects on function leave.
|
thanks, it's perfect |
I think,
create_userdata
just need'lua
. Why require'static
?The text was updated successfully, but these errors were encountered: