diff options
author | kyren <kerriganw@gmail.com> | 2018-02-11 08:51:17 -0500 |
---|---|---|
committer | kyren <kerriganw@gmail.com> | 2018-02-11 08:51:17 -0500 |
commit | ce7e8e61fd9849695527b3c0b04db8f7c7c94db1 (patch) | |
tree | efba810062822e92bc65d84f0a8ffd467101f588 /src/userdata.rs | |
parent | da1e1625b3f8359454a20a44db9ed18a763e11f7 (diff) | |
download | mlua-ce7e8e61fd9849695527b3c0b04db8f7c7c94db1.zip |
shave this yak some more, make `Callback` type alias have two lifetimes
Diffstat (limited to 'src/userdata.rs')
-rw-r--r-- | src/userdata.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/userdata.rs b/src/userdata.rs index c48a1b4..c119911 100644 --- a/src/userdata.rs +++ b/src/userdata.rs @@ -72,8 +72,8 @@ pub enum MetaMethod { /// /// [`UserData`]: trait.UserData.html pub struct UserDataMethods<'lua, T> { - pub(crate) methods: HashMap<StdString, Callback<'lua>>, - pub(crate) meta_methods: HashMap<MetaMethod, Callback<'lua>>, + pub(crate) methods: HashMap<StdString, Callback<'lua, 'static>>, + pub(crate) meta_methods: HashMap<MetaMethod, Callback<'lua, 'static>>, pub(crate) _type: PhantomData<T>, } @@ -175,7 +175,7 @@ impl<'lua, T: UserData> UserDataMethods<'lua, T> { self.meta_methods.insert(meta, Self::box_function(function)); } - fn box_function<A, R, F>(function: F) -> Callback<'lua> + fn box_function<A, R, F>(function: F) -> Callback<'lua, 'static> where A: FromLuaMulti<'lua>, R: ToLuaMulti<'lua>, @@ -184,7 +184,7 @@ impl<'lua, T: UserData> UserDataMethods<'lua, T> { Box::new(move |lua, args| function(lua, A::from_lua_multi(args, lua)?)?.to_lua_multi(lua)) } - fn box_method<A, R, M>(method: M) -> Callback<'lua> + fn box_method<A, R, M>(method: M) -> Callback<'lua, 'static> where A: FromLuaMulti<'lua>, R: ToLuaMulti<'lua>, @@ -205,7 +205,7 @@ impl<'lua, T: UserData> UserDataMethods<'lua, T> { }) } - fn box_method_mut<A, R, M>(method: M) -> Callback<'lua> + fn box_method_mut<A, R, M>(method: M) -> Callback<'lua, 'static> where A: FromLuaMulti<'lua>, R: ToLuaMulti<'lua>, |