It implements `FromLua` and takes ownership of a Lua userdata value.
The semantics is similar to `AnyUserData::take`, preventing any
further use from Lua.
Closes#686
Previously wrapped functions were required to return `mlua::Result`.
Now it's possible to wrap functions returning any errors as long as
they implement `std::error::Error`.
Existing code remains compatible with `mlua::Result` as this type
is not converted to an external error.
RFC: https://rfcs.luau.org/type-long-integer.html
Unfortunately this type is not backward compatible with regular numbers
and require a special "integer" library.
It's not integrated with `Value` enum to keep it simple.
- Replace `gc_inc/gc_gen` with `gc_set_mode`
- Add `GcIncParams` and `GcGenParams` for GC tuning
- Remove `gc_step_kbytes` (it's very rare needed and Lua 5.5 has changed the input param from kbytes to bytes)
The `is_sync::<T>()` runtime check relied on implicit specialization via
`Copy`/`Clone` array behavior, which has changed in Rust 1.86+.
`UserDataRef` always taking an exclusive lock even for `Sync` userdata,
preventing concurrent shared borrows.
With the `send` feature flag enabled, userdata types must now be `Send + Sync`.
This is a breaking change, `T: Send + !Sync` userdata types can be wrapped in a `Mutex`
or used inside a `Scope` where this restriction is lifted.
This functionality uses Luau private api to dump heap mempory in JSON format for inspection.
The new type `HeapDump` represents memory snapshot with some basic API to calculate stats.
This is a follow-up from mlua-rs/lua-src-rs#13 which verifies/tests that
mlua/lua all work when compiled for a WASI target. While this doesn't
have formal documentation yet it also codifies in CI configuration how
to build for WASI and get tests passing (notably C compiler
configuration and some misc Rust flags).
This moves some `dev-dependencies` that don't compile for
`wasm32-wasip2` to a different section of the manifest. This
additionally annotates panicking tests with `#[cfg(not(panic =
"abort"))]` to skip those tests on WASI.
This does not test either the `send` or `async` feature at this time.
Testing `send` requires threads which WASI does not yet support, and
testing `async` requires more support in Tokio which is not currently
there yet.
This option would allow detecting mixed tables (with array-like and map-like entries or several borders)
to encoding them chosing the best method (as a map or as a table).
In particular we cannot yeild across metamethod/C-call boundaries.
This behaviour matches with Lua 5.3+ yielding from hooks only at safe points.
Closes#632