Commit graph

840 commits

Author SHA1 Message Date
Alex Orlenko 9f0378b77e Complitely remove the C shim 2021-06-16 22:21:45 +01:00
Alex Orlenko d3f44354e0 Revert commit ced808d5ab
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-16 22:13:01 +01:00
Alex Orlenko fca21d56d3 Check stack in entrypoint1 before pushing value to a stack 2021-06-13 23:30:56 +01:00
Alex Orlenko 6e52bb7e65 Fix clippy warnings && tests 2021-06-13 23:30:54 +01:00
Alex Orlenko 08ffeb0ca9 Improve module mode:
- Don't hide module function inside `luaopen_%` function.
- Raise Lua exception instead of panic if module function returns error.
2021-06-13 22:38:51 +01:00
Alex Orlenko 3b9d8a7b5f Keep all Lua symbols in unsafe mode to load C modules 2021-06-12 18:00:55 +01:00
Alex Orlenko 0fe898c0dd v0.6.0-beta.3 2021-06-04 12:38:09 +01:00
Alex Orlenko 821f1125b6 Add String::to_string_lossy 2021-06-04 00:16:40 +01:00
Alex Orlenko 6c0096d8ac Update examples 2021-06-03 23:52:29 +01:00
Alex Orlenko abb95c3c56 Remove T: Clone requirement from add_async_function 2021-06-03 23:21:00 +01:00
Alex Orlenko 64faebf407 Add __ipairs metamethod (again) for Lua 5.2 only 2021-06-03 18:43:29 +01:00
Alex Orlenko a944f4ad6f Implement UserData for Rc<RefCell>/Arc<Mutex>/Arc<RwLock> wrappers 2021-06-03 16:42:55 +01:00
Alex Orlenko bae424672a Treat errors as Send + Sync to be compatible with anyhow crate 2021-05-31 11:05:51 +01:00
Alex Orlenko 6f9eb82649 Update README 2021-05-18 20:13:28 +01:00
Alex Orlenko e8de2a458a Allow multiple entrypoints in a single module share the same Lua state.
Previously it would initialize different Lua instances.
Fixes #49.
2021-05-18 20:07:34 +01:00
Alex Orlenko 973b5c3bf5 v0.6.0-beta.2 2021-05-13 23:10:19 +01:00
Alex Orlenko b610a79d66 Update docs & minor error handling code changes 2021-05-11 14:18:22 +01:00
Alex Orlenko fe39ae09bf Try different approach for errors handling.
Instead of convering error to CallbackError in error message handler,
do it earlier at callback_error stage.
Better fix for #44.
2021-05-11 00:53:07 +01:00
Alex Orlenko 01714d2510 Prepare 0.6.0-beta.2 release 2021-05-10 22:28:33 +01:00
Alex Orlenko 0bad4a0ff9 Fix spelling 2021-05-10 19:53:38 +01:00
Alex Orlenko 35b7504076 Improve error reporting in module mode.
Attach traceback to a WrappedError.
Fixes #44.
2021-05-10 17:45:00 +01:00
Alex Orlenko c9b8eb5418 Re-export UserDataFields/UserDataMetatable 2021-05-09 09:30:33 +01:00
Alex Orlenko ef7d123f80 Exclude mlua_derive from coverage report 2021-05-06 00:41:20 +01:00
Alex Orlenko 20cba5de5b Fix clippy warnings 2021-05-06 00:36:47 +01:00
Alex Orlenko 3e03f4201c Add chunk! macro support 2021-05-05 22:13:51 +01:00
Alex Orlenko 5199b02346 Update lua state when polling futures 2021-05-05 12:37:27 +01:00
Alex Orlenko 5293b8d6d2 Add Thread::reset() for luajit/lua54 2021-05-05 11:11:32 +01:00
Alex Orlenko 7541b6f3f3 Remove deprecated AnyUserData::has_metamethod() 2021-05-04 23:57:47 +01:00
Alex Orlenko 205510a540 Update sys align code 2021-05-04 23:55:24 +01:00
Alex Orlenko 2250421438 Fix clippy warnings 2021-05-04 23:42:33 +01:00
Alex Orlenko 8e57e6fa5a v0.6.0-beta.1 2021-05-04 00:43:26 +01:00
Alex Orlenko f2dbbb091f Update dependencies 2021-05-04 00:31:51 +01:00
Alex Orlenko 13cfb4bd51 Add CHANGELOG for v0.6.0-beta.1 2021-05-03 23:36:18 +01:00
Alex Orlenko 33ebacab49 Update README 2021-05-03 22:33:18 +01:00
Alex Orlenko 3829b72212 Update code docs 2021-05-03 22:33:18 +01:00
Alex Orlenko af67971e0d Make SerializeOptions non_exhaustive.
Add builder implementation similar to `LuaOptions` to set individual options.
2021-05-03 22:33:12 +01:00
Alex Orlenko 0f4bcca7ce Add LuaOptions to customize Lua/Rust behaviour.
The only option is `catch_rust_panics` to optionally disable catching Rust panics via pcall/xpcall.
2021-05-03 21:33:49 +01:00
Alex Orlenko 585c0a25d8 Replace 'Thread already finished' error with common Error::CoroutineInactive 2021-05-03 13:11:59 +01:00
Alex Orlenko 64346ce56c Implement/Derive Debug for Lua and few other structs 2021-05-03 13:05:43 +01:00
Alex Orlenko 108682cc71 Store safe property in Extra state to inherit into Lua structs made from pointers 2021-05-03 12:40:14 +01:00
Alex Orlenko 4af7bcf0d9 Implement ToLua/FromLua for Box<str> and Box<[T]> 2021-05-03 12:22:11 +01:00
Alex Orlenko 1bb3c5c19f Fix typo in README 2021-05-02 23:53:48 +01:00
Alex Orlenko a4567cb5f7 Improve growing the auxiliary stack of the ref thread:
Try to double size first, if not fulfilled try halving in a loop till 0.
Fix unwinding after panic in ref_stack_pop.
Add test to check the stack exhaustion.
2021-05-02 23:26:02 +01:00
Alex Orlenko 26d8d899f2 Allocate Waker slot in Registry in re-use it (instead of creating new userdata for it) 2021-05-02 13:04:02 +01:00
Alex Orlenko 67bc0b1196 Make AsyncPollPending internal value as LightUserData 2021-05-02 12:06:32 +01:00
Alex Orlenko e8505b5239 Change signature of Function::dump() to remove Result 2021-05-02 11:48:42 +01:00
Alex Orlenko 3f55958bdd Stack assertions review
Other minor code and documentation updates
2021-05-02 11:42:03 +01:00
Alex Orlenko 463fc646bc Refactor UserDataCell 2021-04-27 21:55:31 +01:00
Alex Orlenko b5f1325f2f Store nonstatic UserData pointer in self userdata (instead of metatable) 2021-04-27 17:06:37 +01:00
Alex Orlenko 0625991a48 Update github action to fix modules test on Windows (lua53 -> lua54) 2021-04-27 10:38:20 +01:00