Alex Orlenko
27f91dfd1b
Accept any error in Function::wrap/wrap_mut/wrap_async
...
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.
2026-04-18 16:01:35 +01:00
Alex Orlenko
c8436e2b80
Make function module public
...
Reduce number of function-specific types exported to the mlua root and keep
them inside the module.
2026-01-30 13:18:05 +00:00
Alex Orlenko
2ace892613
Rename string::String to LuaString
2026-01-29 18:45:41 +00:00
Alex Orlenko
171cdf1758
Some fixes and more tests for Function::info
2026-01-23 12:44:22 +00:00
Alex Orlenko
f539f60987
Fix Function::deep_clone() method (Luau).
...
The `lua_clonefunction` function can fail (and trigger GC) so we need to return Result instead of allowing longjmp
2025-06-16 21:41:29 +01:00
Joel Natividad
20f7ce097d
Fix typos ( #522 )
...
* fix various typos in the codebase
* fix typos in CHANGELOG.md
2025-02-05 16:16:20 +00:00
Alex Orlenko
7535a23fa2
Update function tests
2024-10-16 15:59:13 +01:00
Alex Orlenko
91fe02da45
Add LuaNativeFn/LuaNativeFnMut/LuaNativeAsyncFn traits for using in Function::wrap
2024-09-24 14:35:03 +01:00
Alex Orlenko
104e242ddd
Some cosmetic changes
2024-09-01 22:48:56 +01:00
Alex Orlenko
825bdbfa04
Use dynamic Lua state ownership instead of compile-time module cfg flag to allow
...
creating new VMs in module mode (and destructing them properly).
2024-08-31 22:52:55 +01:00
Alex Orlenko
3641c98959
Prepare for Rust 2024 edition (see rust-lang/rust#123748 )
...
Replace `IntoLua(Multi)` generic with positional arg (impl trait) where possible
This allow to shorten syntax from `a.get::<_, T>` to `a.get::<T>`
2024-07-31 23:42:43 +01:00
Alex Orlenko
b4892c228c
Add rustfmt.toml
2024-07-31 13:42:37 +01:00
Alex Orlenko
7221051683
Refactor:
...
- Remove the rest of `'lua` lifetimes
- Remove Owned types
2024-07-31 13:42:35 +01:00
Alex Orlenko
9734146313
Add Function::deep_clone() (Luau only)
2024-03-21 22:14:00 +00:00
Alex Orlenko
908f37656a
Add to_pointer function to Function/Table/Thread
2024-02-02 09:23:16 +00:00
Alex Orlenko
9f5325ef2f
Use c-unwind ABI (Rust 1.71+)
2023-07-22 23:54:30 +01:00
Alex Orlenko
b3b8d79446
Make Debug interface more user friendly
...
- use String instead of Vec<u8>
- update docs
- unify fields between lua5.x/luau
- line numbers are `usize`
2023-07-06 00:38:33 +01:00
Alex Orlenko
1dc32452e6
Support getting and setting environment for Lua functions.
...
Closes #218
2023-06-03 12:56:49 +01:00
Alex Orlenko
3abf73dee5
Update FunctionInfo doc and interface
2023-05-30 00:33:57 +01:00
Alex Orlenko
4daa7de997
Various improvements for owned types, including:
...
- tests
- shortcuts for `OwnedFunction` and `OwnedAnyUserData`
2023-04-26 15:40:48 +01:00
Alex Orlenko
65e72f39ae
Remove unstable feature flag from Function::wrap/wrap_mut/wrap_async
2023-04-14 00:21:18 +01:00
Alex Orlenko
1d4a135e8e
Add Function::wrap/Function::wrap_mut/Function::wrap_async to wrap functions into a type that implements IntoLua trait.
...
This is useful to avoid calling `lua.create_function*` every time when `Function` handle is needed.
2022-12-22 16:24:35 +00:00
Alex Orlenko
56abc4a700
Refactor AsChunk trait
2022-12-19 21:12:36 +00:00
Alex Orlenko
40fe937878
Fix a bug in Function::bind when args and binds are empty
...
This leads to a Lua assertion due to using wrong stack index
2022-07-22 00:24:53 +01:00
Alex Orlenko
5133a9837a
Add Function::info() to get information about functions.
...
Closes #149 and #7 .
2022-04-18 18:28:11 +01:00
Alex Orlenko
c322e028e2
Initial Luau support
2022-03-20 20:30:20 +00:00
Alex Orlenko
1fe583027b
Add new functions: lua.load_from_function() and lua.create_c_function()
...
This should be useful to register embedded C modules to Lua state.
Provides a solution for #61
2021-07-05 00:03:18 +01:00
Alex Orlenko
e8505b5239
Change signature of Function::dump() to remove Result
2021-05-02 11:48:42 +01:00
Alex Orlenko
e26cec5db9
Drop 'feature(link_args)' (removed from nightly). Don't run tests for LuaJIT 2.0.5
2021-04-16 22:27:28 +01:00
Alex Orlenko
d201beadc9
Add ChunkMode enum to mark chunks as text or binary
2020-07-28 21:04:21 +01:00
Alex Orlenko
dd58cdad52
Add Function::dump() to dump lua function to a binary chunk
2020-07-27 23:26:33 +01:00
Alex Orlenko
2fd6757f39
Add LuaJIT 2.0.5 stable support
2020-06-06 16:07:16 +01:00
Alex Orlenko
222f4df668
Add family of call_async function
...
Update documentation
Move async tests to a separate file
2020-04-18 21:26:12 +01:00
Alex Orlenko
47e8a80c1c
v0.3.0-alpha.1 with async support
...
Squashed commit of the async branch.
2020-04-17 22:39:50 +01:00
Alex Orlenko
07fc4642ae
Support vendored versions of Lua and LuaJIT
2020-01-25 20:47:31 +00:00
Alex Orlenko
6f42a6cca9
Add LuaJIT support
2019-11-04 22:23:15 +00:00
Alex Orlenko
c4fd7a9faf
Lua 5.1 support
2019-10-17 17:05:42 +01:00
Alex Orlenko
cb109f6e36
Rename to mlua
2019-10-01 16:11:12 +01:00
Alex Orlenko
54f4627195
Update tests (excl. compile-fail)
2019-09-29 13:03:32 +01:00
Alex Orlenko
b23ee6a162
cargo fmt
2019-09-29 12:56:03 +01:00
kyren
65d8ad2f86
Allow non-utf8 Lua source in load / exec / eval
2018-10-01 06:00:21 -04:00
kyren
b8da08187d
Move integration tests into top-level tests directory
...
other minor refactors
2018-09-16 20:15:51 -04:00