Modules

Macros

A helper macro that combine error_with_message and format together.

Structs

Represents the execution context of the current function.

Represents a function to add to a Lua table.

Represents a method of a Lua object.

Constants

Statics

Traits

A trait for implement Lua closure.

A trait for implement Lua object.

A trait to allow Rust object to be able to get collected by Lua GC.

Functions

Converts the acceptable index index into an equivalent absolute index (that is, one that does not depend on the stack size).

Raises an error reporting a problem with argument arg of the function that called it, using a standard message that includes comment as a comment:

Checks whether the function argument arg is a string and returns this string.

Creates a new empty table and pushes it onto the stack. Parameter elements is a hint for how many elements the table will have as a sequence; parameter fields is a hint for how many other elements the table will have. Lua may use these hints to preallocate memory for the new table. This preallocation may help performance when you know in advance how many elements the table will have.

Raises a Lua error, using the value on the top of the stack as the error object.

Raises a Lua error with the specified message.

Pushes onto the stack the value t[key], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the “index” event.

Returns true if the given index is not valid or if the value at this index is nil, and false otherwise.

This function creates and pushes on the stack a new full userdata, with Rust object associated Lua values.

If the function argument arg is a string, returns this string. If this argument is absent or is nil, returns None. Otherwise, raises an error.

Pops count elements from the stack.

Pushes a new closure onto the stack.

Pushes a new function onto the stack.

Pushes a nil value onto the stack.

Pushes a string onto the stack. The string can contain any binary data, including embedded zeros.

Pushes a copy of the element at the given index onto the stack.

Does the equivalent to t[key] = v, where t is the value at the given index and v is the value on the top of the stack.

Registers all functions in the entries into the table on the top of the stack. When upvalues is not zero, all functions are created with upvalues upvalues, initialized with copies of the upvalues values previously pushed on the stack on top of the library table. These values are popped from the stack after the registration.

Pops a table or nil from the stack and sets that value as the new metatable for the value at the given index (nil means no metatable).

Converts the Lua value at the given index to a string.

Raises a type error for the argument arg of the function that called it, using a standard message; expect is a “name” for the expected type.

Returns the pseudo-index that represents the i-th upvalue of the running function. i must be in the range [1,256].

Type Definitions