Highlights
More ergonomic UserData building blocks
- Declaratively implement
UserDatawith#[derive(UserData)]and register methods/fields with the new#[mlua::userdata_impl]attribute macro. UserDataOwned<T>wrapper takes ownership of userdata and implementsFromLuaUserDataMethods::add_method_once/add_async_method_once__todebugstringmetamethod for pretty-printing userdata when debuggingMaybeSynctrait for userdata under thesendfeature
Reorganized public API
Types are now grouped into focused modules: chunk, debug, error, function, table, string, state, thread, userdata and luau.
Thread lifecycle callbacks
Hook into coroutine create/resume/yield events across all Lua versions (when using mlua API).
Luau improvements
Latest Luau with extended require-by-string support and JIT options.
Garbage-collector interface refactor
Lua::gc_inc / Lua::gc_gen are replaced by a Lua::gc_set_mode, with GcIncParams/GcGenParams for fine-grained tuning.
What's Changed (since v0.12.0-rc.2)
- Crate root re-exports are refactored (only essentials are re-exported, the rest is in the new submodules)
- Added
ThreadStatus::NormalandThread::is_normal(mimiccoroutine.status) - Added
Lua::set_jit_optionswith support of Luau JIT inliner (Luau) - Added
Value::as_vector/Value::is_vector(Luau) - Added
Table::remove serde: tables with the array metatable are always encoded as arrays (incl.detect_mixed_tablesoption)- impl
HashforBorrowedStr/BorrowedBytes Lua::current_threadresolves implicit async threads to their root owner (#706)- Bugfixes and improvements
Full Changelog: v0.11.6...v0.12.0