Module mlua

Source
Available on crate feature mlua only.
Expand description

Integrations with the mlua Rust crate providing safe Lua bindings.

Modules§

ffi
Low level bindings to Lua 5.4/5.3/5.2/5.1 (including LuaJIT) and Luau.
prelude
Re-exports most types with an extra Lua* prefix to prevent name clashes.

Structs§

AnyUserData
Handle to an internal Lua userdata for any type that implements UserData.
AppDataRef
A wrapper type for an immutably borrowed value from an app data container.
AppDataRefMut
A wrapper type for a mutably borrowed value from an app data container.
BString
A wrapper for Vec<u8> that provides convenient string oriented trait impls.
BorrowedBytes
A borrowed byte slice (&[u8]) that holds a strong reference to the Lua state.
BorrowedStr
A borrowed string (&str) that holds a strong reference to the Lua state.
Chunk
Returned from Lua::load and is used to finalize loading and executing Lua main chunks.
Debug
Contains information about currently executing Lua code.
DebugNames
DebugSource
DebugStack
Function
Handle to an internal Lua function.
FunctionInfo
Contains information about a function.
HookTriggers
Determines when a hook function will be called by Lua.
LightUserData
A “light” userdata value. Equivalent to an unmanaged raw pointer.
Lua
Top level Lua struct which represents an instance of Lua VM.
LuaOptions
Controls Lua interpreter behavior such as Rust panics handling.
MultiValue
Multiple Lua values used for both argument passing and also for multiple return values.
RegistryKey
An auto generated key into the Lua registry.
Scope
Constructed by the Lua::scope method, allows temporarily creating Lua userdata and callbacks that are not required to be Send or 'static.
StdLib
Flags describing the set of lua standard libraries to load.
String
Handle to an internal Lua string.
Table
Handle to an internal Lua table.
TablePairs
An iterator over the pairs of a Lua table.
TableSequence
An iterator over the sequence part of a Lua table.
Thread
Handle to an internal Lua thread (coroutine).
UserDataMetatable
Handle to a AnyUserData metatable.
UserDataRef
A wrapper type for a userdata value that provides read access.
UserDataRefMut
A wrapper type for a userdata value that provides read and write access.
UserDataRegistry
Handle to registry for userdata methods and metamethods.
Variadic
Wraps a variable number of Ts.
WeakLua
Weak reference to Lua instance.
lua_State
A raw Lua state associated with a thread.

Enums§

ChunkMode
Represents chunk mode (text or binary).
DebugEvent
Represents a specific event that triggered the hook.
Either
The enum Either with variants Left and Right is a general purpose sum type with two cases.
Error
Error type returned by mlua methods.
GCMode
Mode of the Lua garbage collector (GC).
MetaMethod
Kinds of metamethods that can be overridden.
ThreadStatus
Status of a Lua thread (coroutine).
Value
A dynamically typed Lua value.
VmState
Type to set next Lua VM action after executing interrupt or hook function.

Traits§

AsChunk
Trait for types loadable by Lua and convertible to a Chunk
ErrorContext
Provides the context method for Error and Result<T, Error>.
ExternalError
Trait for converting std::error::Error into Lua Error.
ExternalResult
Trait for converting std::result::Result into Lua Result.
FromLua
Trait for types convertible from Value.
FromLuaMulti
Trait for types that can be created from an arbitrary number of Lua values.
IntoLua
Trait for types convertible to Value.
IntoLuaMulti
Trait for types convertible to any number of Lua values.
LuaNativeFn
A trait for types that can be used as Lua functions.
LuaNativeFnMut
A trait for types with mutable state that can be used as Lua functions.
MaybeSend
ObjectLike
A trait for types that can be used as Lua objects (usually table and userdata).
UserData
Trait for custom userdata types.
UserDataFields
Field registry for UserData implementors.
UserDataMethods
Method registry for UserData implementors.

Functions§

lua
Returns a mlua::Lua instance which can be used to interact with Lua plugins.

Type Aliases§

Integer
Type of Lua integer numbers.
Number
Type of Lua floating point numbers.
Result
A specialized Result type used by mlua’s API.
lua_CFunction
Type for native C functions that can be passed to Lua.