mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
9fdba541e9
New functions: `UserDataMethods::add_async_method_mut()`, `UserDataMethods::add_async_meta_method_mut()`.
15 lines
347 B
Rust
15 lines
347 B
Rust
use mlua::{UserData, UserDataMethods};
|
|
|
|
struct MyUserData;
|
|
|
|
impl UserData for MyUserData {
|
|
fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M) {
|
|
methods.add_async_method("method", |_, this: &'static Self, ()| async {
|
|
Ok(())
|
|
});
|
|
// ^ lifetime may not live long enough
|
|
}
|
|
}
|
|
|
|
fn main() {}
|