mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
15 lines
320 B
Rust
15 lines
320 B
Rust
use mlua::{Lua, Table};
|
|
|
|
fn main() {
|
|
let lua = Lua::new();
|
|
lua.scope(|scope| {
|
|
let mut inner: Option<Table> = None;
|
|
let f = scope.create_function_mut(|_, t: Table| {
|
|
inner = Some(t);
|
|
Ok(())
|
|
})?;
|
|
f.call::<()>(lua.create_table()?)?;
|
|
Ok(())
|
|
});
|
|
}
|