Struct rlua::Lua [] [src]

pub struct Lua { /* fields omitted */ }

Top level Lua struct which holds the Lua state itself.

Methods

impl Lua
[src]

Creates a new Lua state.

Also loads the standard library.

Loads a chunk of Lua code and returns it as a function.

The source can be named by setting the name parameter. This is generally recommended as it results in better error traces.

Equivalent to Lua's load function.

Execute a chunk of Lua code.

This is equivalent to simply loading the source with load and then calling the resulting function with no arguments.

Returns the values returned by the chunk.

Evaluate the given expression or chunk inside this Lua state.

If source is an expression, returns the value it evaluates to. Otherwise, returns the values returned by the chunk (if any).

Pass a &str slice to Lua, creating and returning a interned Lua string.

Creates and returns a new table.

Creates a table and fills it with values from an iterator.

Creates a table from an iterator of values, using 1.. as the keys.

Wraps a Rust function or closure, creating a callable Lua function handle to it.

Wraps a Lua function into a new thread (or coroutine).

Equivalent to coroutine.create.

Create a Lua userdata object from a custom userdata type.

Returns a handle to the global environment.

Coerces a Lua value to a string.

The value must be a string (in which case this is a no-op) or a number.

Coerces a Lua value to an integer.

The value must be an integer, or a floating point number or a string that can be converted to an integer. Refer to the Lua manual for details.

Coerce a Lua value to a number.

The value must be a number or a string that can be converted to a number. Refer to the Lua manual for details.

Packs up a value that implements ToLuaMulti into a LuaMultiValue instance.

This can be used to return arbitrary Lua values from a Rust function back to Lua.

Unpacks a LuaMultiValue instance into a value that implements FromLuaMulti.

This can be used to convert the arguments of a Rust function called by Lua.

Trait Implementations

impl Drop for Lua
[src]

A method called when the value goes out of scope. Read more