pub struct ModuleBuilder<'lua> { /* private fields */ }Expand description
Builder that construct a module based on the Module trait
Trait Implementations§
Source§impl<'lua> ModuleFields for ModuleBuilder<'lua>
impl<'lua> ModuleFields for ModuleBuilder<'lua>
Source§impl<'lua> ModuleMethods for ModuleBuilder<'lua>
impl<'lua> ModuleMethods for ModuleBuilder<'lua>
Source§fn add_function<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>where
K: IntoLua,
F: Fn(&Lua, A) -> Result<R> + MaybeSend + 'static,
A: FromLuaMulti,
R: IntoLuaMulti,
fn add_function<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>where
K: IntoLua,
F: Fn(&Lua, A) -> Result<R> + MaybeSend + 'static,
A: FromLuaMulti,
R: IntoLuaMulti,
Add a function to this module’s table
Source§fn add_meta_function<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>where
K: IntoLua,
F: Fn(&Lua, A) -> Result<R> + MaybeSend + 'static,
A: FromLuaMulti,
R: IntoLuaMulti,
fn add_meta_function<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>where
K: IntoLua,
F: Fn(&Lua, A) -> Result<R> + MaybeSend + 'static,
A: FromLuaMulti,
R: IntoLuaMulti,
Add a function to this module’s metatable
Source§fn add_method<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>where
K: IntoLua,
F: Fn(&Lua, Table, A) -> Result<R> + MaybeSend + 'static,
A: FromLuaMulti,
R: IntoLuaMulti,
fn add_method<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>where
K: IntoLua,
F: Fn(&Lua, Table, A) -> Result<R> + MaybeSend + 'static,
A: FromLuaMulti,
R: IntoLuaMulti,
Add a method to this module’s table
Source§fn add_meta_method<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>where
K: IntoLua,
F: Fn(&Lua, Table, A) -> Result<R> + MaybeSend + 'static,
A: FromLuaMulti,
R: IntoLuaMulti,
fn add_meta_method<K, F, A, R>(&mut self, name: K, function: F) -> Result<()>where
K: IntoLua,
F: Fn(&Lua, Table, A) -> Result<R> + MaybeSend + 'static,
A: FromLuaMulti,
R: IntoLuaMulti,
Add a method to this module’s metatable
Auto Trait Implementations§
impl<'lua> Freeze for ModuleBuilder<'lua>
impl<'lua> !RefUnwindSafe for ModuleBuilder<'lua>
impl<'lua> Send for ModuleBuilder<'lua>
impl<'lua> Sync for ModuleBuilder<'lua>
impl<'lua> Unpin for ModuleBuilder<'lua>
impl<'lua> UnsafeUnpin for ModuleBuilder<'lua>
impl<'lua> !UnwindSafe for ModuleBuilder<'lua>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more