mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
16 lines
249 B
Rust
16 lines
249 B
Rust
use mlua::Result;
|
|
|
|
#[derive(Clone, Debug, mlua::UserData)]
|
|
struct Foo(u64);
|
|
|
|
#[mlua::userdata_impl]
|
|
impl Foo {
|
|
#[lua(setter)]
|
|
async fn set_value(&mut self, val: u64) -> Result<()> {
|
|
self.0 = val;
|
|
Ok(())
|
|
}
|
|
}
|
|
|
|
fn main() {}
|