summaryrefslogtreecommitdiff
path: root/src/scope.rs
AgeCommit message (Collapse)Author
2023-02-03Allow registering and creating custom userdata types that don't necessary ↵Alex Orlenko
implement the `UserData` trait. This is useful to register 3rd party types that cannot implement `UserData` due to Rust orphan rules. See #206
2022-12-24Refactor `userdata::MetaMethod`.Alex Orlenko
Take `impl AsRef<str>` as name of metamethod (instead of `Into<MetaMethod>`) in UserDataMethods/UserDataFields. Change position of generic args in userdata.
2022-12-19Rename ToLua/ToLuaMulti -> IntoLua/IntoLuaMultiAlex Orlenko
2022-12-19Refactor LuaInner stateAlex Orlenko
Add static_assertions to check for auto traits impl on compilation stage Bump MSRV to 1.63 (required for `Ref::filter_map`)
2022-12-18Replace `impl AsRef<str>` with simple `&str`Alex Orlenko
2022-12-18Use `impl AsRef<str>` for userdata methods/fields instead of generic param.Alex Orlenko
Use `impl AsRef<str>` for module names and named registry values.
2022-06-28Make clippy happyAlex Orlenko
2022-06-06More performance optimization (userdata part)Alex Orlenko
2022-03-22Fix clippy warningsAlex Orlenko
2022-03-21Enable `Lua::inspect_stack` for LuauAlex Orlenko
2022-03-20Initial Luau supportAlex Orlenko
2021-11-08Add `set_nth_user_value` and `get_nth_user_value` to `AnyUserData`Alex Orlenko
with `n` up to 65535 for all Lua versions.
2021-11-04Add async meta methods for all Lua except 51Alex Orlenko
2021-10-12Update documentation referencesAlex Orlenko
Using rustdoc links (see RFC https://github.com/rust-lang/rfcs/pull/1946)
2021-10-05Add (hidden) method `UserData::take()` to take out value from userdataAlex Orlenko
2021-09-28Update check_stack requirementsAlex Orlenko
2021-09-28Refactor UserData metatables handlingAlex Orlenko
2021-09-28Make `protect_lua` as a smart macro to choose from C/closureAlex Orlenko
2021-07-08Revert "Make `protect_lua` as a smart macro to choose from C/closure"Alex Orlenko
This reverts commit 84fe5f7f761e5a9669ae00df3f6e48ef2814272c.
2021-07-07Make `protect_lua` as a smart macro to choose from C/closureAlex Orlenko
2021-06-30Optimize callback creationAlex Orlenko
Attach only one upvalue to callbacks rather than two. This leads to less lookup to Lua registry.
2021-06-21Fix clippy warningAlex Orlenko
2021-06-18Fix userdata memleak in edge case.Alex Orlenko
This can happen if we unable to push metatable with `__gc` metamethod after pushing userdata. In this case Lua will never execute drop. Instead, we will push metatable first and then userdata.
2021-06-16Revert commit ced808d5abAlex Orlenko
I think this experiment is unsuccessful and does not work well in a module mode with dynamic symbols resolution and mixing between different mlua instances. Overall the Rust bug has been fixed and we can wait for the "C-unwind" feature become stable.
2021-06-03Remove `T: Clone` requirement from `add_async_function`Alex Orlenko
2021-06-03Implement `UserData` for Rc<RefCell>/Arc<Mutex>/Arc<RwLock> wrappersAlex Orlenko
2021-05-02Stack assertions reviewAlex Orlenko
Other minor code and documentation updates
2021-04-27Refactor UserDataCellAlex Orlenko
2021-04-27Store nonstatic UserData pointer in self userdata (instead of metatable)Alex Orlenko
2021-04-27Fix lua51 scope compilationAlex Orlenko
2021-04-27cargo fmt and other minor fixesAlex Orlenko
2021-04-27Don't trigger longjmp in rust.Alex Orlenko
Motivation behind this change is upcoming breaking change in Rust compiler v1.52.0 to prevent unwinding across FFI boundaries. https://github.com/rust-lang/rust/pull/76570 The new functionality requires nightly compiler to declare FFI functions as "C-unwind". The fundamental solution is to use C shim to wrap "e" and "m" Lua functions in pcall. Additionally define Rust calling convention to trigger lua_error on Rust behalf.
2021-04-27Fix some clippy warnings & minor changesAlex Orlenko
2021-04-27Improve/fix scoped UserData dropAlex Orlenko
2021-04-27Add `UserDataFields` API.Alex Orlenko
Provide safe access to UserData metatable and allow to define custom metamethods..
2021-04-16Serialize only known (registered) userdata.Alex Orlenko
This reverts commit 7332c6a. Non-static userdata is a special case and can cause segfault if try to serialize it. Now it should be safe, plus I added non-static userdata destructor to generate better error messages in case of accessing destructed userdata.
2021-02-21Fix scoped async destruction of partially polled futuresAlex Orlenko
2020-12-31Update documentationAlex Orlenko
2020-12-14Serde support (serialize feature flag)Alex Orlenko
2020-05-15Update documentationAlex Orlenko
2020-05-15Add clippy check and fix clippy warningsAlex Orlenko
2020-05-11Add Lua 5.4 (rc2) supportAlex Orlenko
2020-05-11Scope support (including async)Alex Orlenko
2020-04-17v0.3.0-alpha.1 with async supportAlex Orlenko
Squashed commit of the async branch.
2019-11-30Add Lua 5.2 supportAlex Orlenko
2019-11-04Move lua 5.1 support under new "lua51" featureAlex Orlenko
2019-10-17Lua 5.1 supportAlex Orlenko
2019-09-29cargo fmtAlex Orlenko
2019-09-29Backport changes from rlua 0.16 (master branch)Alex Orlenko
2018-09-16Rename Scope::create_userdata to Scope::create_nonstatic_userdatakyren
avoids clashing with the previous method name to avoid confusion