Struct rlua::LuaUserDataMethods
[−]
[src]
pub struct LuaUserDataMethods<T> { /* fields omitted */ }
Methods added will be added to the __index table on the metatable for the userdata, so they can be called as userdata:method(args) as expected. If there are any regular methods, and an "Index" metamethod is given, it will be called as a fallback if the index doesn't match an existing regular method.
Methods
impl<T: LuaUserDataType> LuaUserDataMethods<T>
[src]
fn add_method<M>(&mut self, name: &str, method: M) where
M: 'static + for<'a, 'lua> FnMut(&'lua Lua, &'a T, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
M: 'static + for<'a, 'lua> FnMut(&'lua Lua, &'a T, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
Add a regular method as a function which accepts a &T parameter
fn add_method_mut<M>(&mut self, name: &str, method: M) where
M: 'static + for<'a, 'lua> FnMut(&'lua Lua, &'a mut T, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
M: 'static + for<'a, 'lua> FnMut(&'lua Lua, &'a mut T, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
Add a regular method as a function which accepts a &mut T parameter
fn add_function<F>(&mut self, name: &str, function: F) where
F: 'static + for<'a, 'lua> FnMut(&'lua Lua, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
F: 'static + for<'a, 'lua> FnMut(&'lua Lua, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
Add a regular method as a function which accepts generic arguments, the first argument will always be a LuaUserData of real type T
fn add_meta_method<M>(&mut self, meta: LuaMetaMethod, method: M) where
M: 'static + for<'a, 'lua> FnMut(&'lua Lua, &'a T, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
M: 'static + for<'a, 'lua> FnMut(&'lua Lua, &'a T, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
Add a metamethod as a function which accepts a &T parameter
fn add_meta_method_mut<M>(&mut self, meta: LuaMetaMethod, method: M) where
M: 'static + for<'a, 'lua> FnMut(&'lua Lua, &'a mut T, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
M: 'static + for<'a, 'lua> FnMut(&'lua Lua, &'a mut T, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
Add a metamethod as a function which accepts a &mut T parameter
fn add_meta_function<F>(&mut self, meta: LuaMetaMethod, function: F) where
F: 'static + for<'a, 'lua> FnMut(&'lua Lua, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
F: 'static + for<'a, 'lua> FnMut(&'lua Lua, LuaMultiValue<'lua>) -> LuaResult<LuaMultiValue<'lua>>,
Add a metamethod as a function which accepts generic arguments, the first argument will always be a LuaUserData of real type T