Expand description
Macros§
- impl_
simple_ userdata - Implement
UserDataTraitfor types that only need type name and downcast support. These types use metatables for their Lua-visible API (e.g., IO file handles). - lua_
module - Public builder macro for simple Lua module registration.
- lua_
preload_ module - Public helper macro for simple preload-module registration.
Structs§
- Async
Call Handle - A reusable async call handle that keeps a runner coroutine alive across multiple calls to the same Lua function.
- Async
Thread - Wraps a Lua coroutine as a Rust
Future. - Call
Info - Information about a single function call on the call stack This is similar to CallInfo in lstate.h
- Chunk
- Builder returned by
LuaApi::load, similar tomlua::Chunk. - Debug
Info - Debug information about a function or stack frame.
Mirrors C Lua’s
lua_Debugstruct from lua.h. - Function
- Safe wrapper around a callable Lua function handle.
- Global
State - Global VM state (equivalent to global_State in Lua C API) Manages global resources shared by all execution threads/coroutines
- Instruction
- Zero-cost abstraction for Lua 5.5 instruction encoding Internally stores a 32-bit instruction following Lua 5.5 format
- Library
Module - A library module containing multiple functions and values
- Library
Registry - Registry for all Lua standard libraries
- Lua
- Safe, embedding-oriented Lua runtime.
- LuaAny
Ref - A generic user-facing reference to any Lua value.
- LuaFull
Error - Rich error type combining
LuaErrorkind with the actual Lua error message. - LuaFunction
- LuaFunction
Ref - A user-facing reference to a Lua function (Lua closure, C function, or Rust closure).
- LuaProto
- Compiled chunk (bytecode + metadata)
- LuaState
- Execution state for a Lua thread/coroutine This is separate from LuaVM (global_State) to support multiple execution contexts
- LuaString
- Safe handle to a Lua string kept alive in the registry.
- LuaString
Ref - A user-facing reference to a Lua string.
- LuaTable
- LuaTable
Ref - A user-facing reference to a Lua table.
- LuaUserdata
- Userdata - arbitrary Rust data with optional metatable.
- LuaValue
- Lua 5.5 TValue structure (16 bytes)
- Opaque
User Data - Wraps any
T: 'staticas an opaque Lua userdata. - Preload
Module - A simple
require()-loadable preload module. - RefUser
Data - A userdata wrapper that holds a raw pointer to an external
T: UserDataTrait. - Safe
Option - Scope
- Lexical scope for non-
'staticLua values. - Scoped
Function - A Lua function handle tied to a lexical scope.
- Scoped
User Data - Borrowed userdata handle tied to a lexical scope.
- Table
- Safe wrapper around a Lua table handle.
- Table
Builder - Fluent builder for Lua tables.
- User
Data Builder - Builder for creating userdata from arbitrary types.
- User
Data Ref - A typed user-facing reference to Lua userdata.
- Value
- Safe handle to any Lua value stored in the registry.
Enums§
- Async
Return Value - Return value from an async function.
- LuaError
- Lightweight error enum - only 1 byte! Actual error data stored in VM to reduce Result size
- LuaValue
Kind - OpCode
- Complete Lua 5.5 Opcode Set (86 opcodes) Based on lopcodes.h from Lua 5.5.0
- Stdlib
- UdValue
- Intermediate value type for userdata field/method returns.
Constants§
Traits§
- FromLua
- Convert a
LuaValueinto a Rust type. - From
LuaMulti - Convert a Lua multi-return list into a Rust type.
- Into
Async Lua - Convert a Rust value into async Lua return values without access to a live LuaState.
- IntoLua
- Convert a Rust type into a
LuaValueand push it. - LuaApi
- High-level, embedding-oriented API shared by safe host-side Lua handles.
- LuaAsync
Api - Async high-level API shared by safe host-side Lua handles.
- LuaEnum
- Trait for Rust enums that can be exported to Lua as a table of constants.
- LuaLibrary
- Unified installation interface for libraries provided by luars or external crates.
- LuaMethod
Provider - Blanket trait providing a default no-op method lookup.
- LuaRegistrable
- Trait for types that can be registered with Lua via
register_type_of::<T>. - LuaStatic
Method Provider - Blanket trait providing a default empty static methods list.
- User
Data Trait - Describes how a userdata type can be accessed from Lua.
Functions§
- deserialize_
chunk - Deserialize binary data to a Chunk
- deserialize_
chunk_ with_ strings - Deserialize binary data to a Chunk, returning string constants separately
- deserialize_
chunk_ with_ strings_ vm - Deserialize binary data to a Chunk, directly creating strings with VM
- serialize_
chunk - Serialize a Chunk to binary format (with string deduplication but no VM strings)
- serialize_
chunk_ with_ pool - Serialize a Chunk to binary format (requires ObjectPool for string access)
Type Aliases§
- Async
Future - Type-erased async future stored in LuaState.pending_future.
Returns
AsyncReturnValues which are converted toLuaValues by theAsyncThreadusing the VM’s string interner. NotSend— must run on a single-threaded / LocalSet executor. - CFunction
- C Function type - Rust function callable from Lua Now takes LuaContext instead of LuaVM for better ergonomics
- LuaResult
- Rust
Callback - Rust closure callback — can capture arbitrary Rust state via
Box<dyn Fn>
Attribute Macros§
- lua_
methods - Attribute macro on impl blocks — exposes public methods to Lua.
Derive Macros§
- LuaUser
Data - Derive
UserDataTraitfor a struct or enum.