pub struct LuaModule<'a, 'b> { /* private fields */ }
Expand description

(Sub-)module in a LuaMachine (which is a Lua table)

The type LuaModule is used to implement the abstract Module trait which allows getting and setting variables (through Module::get and Module::set, respectively) a module (in this case: in a Lua table). A LuaModule may be obtained by calling HasModules::module on the LuaMachine (to obtain a top-level module/table) or Module::module on a LuaModule (to obtain a sub module/table, respectively).

To set global variables, use Globals::get and Globals::set directly on the LuaMachine instead.

Lifetimes

Lifetime argument 'a corresponds to the lifetime argument 'a of LuaMachine. It is a lower bound for closures passed to the Lua machine.

Lifetime argument 'b corresponds to the lifetime of the shared reference to the LuaMachine being worked with.

Trait Implementations

Open a sub-module (create if non-existent)

Get value from module

Set value in module

Machine type which the module belongs to

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.