Alex Orlenko
d9c139b55f
Rust 2024
2026-01-29 10:33:28 +00:00
Alex Orlenko
171cdf1758
Some fixes and more tests for Function::info
2026-01-23 12:44:22 +00:00
psentee
3f8f016daa
Add num_params, is_vararg, nups to FunctionInfo ( #665 )
2026-01-23 11:59:59 +00:00
Alex Orlenko
77d7d5d6bd
Add initial Lua 5.5 support
2026-01-13 23:43:31 +00:00
Alex Orlenko
5b38af9746
AsyncCallFuture is Unpin
2025-09-19 10:00:28 +01:00
Alex Orlenko
95367855c1
Return AsyncCallFuture<R> instead of opaque impl Future from ObjectLike trait.
2025-07-12 15:30:58 +01:00
Alex Orlenko
49389c4aa4
Wrap Function::coverage callback to RefCell (Luau)
2025-07-12 13:34:39 +01: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
Alex Orlenko
b3854d2f1d
Add '=' prefix to __mlua_bind name
2025-05-28 14:03:10 +01:00
Alex Orlenko
c0c802262e
Add must_use to AsyncCallFuture
2025-05-06 22:48:48 +01:00
Alex Orlenko
93adfa42d1
Update doc comments
2025-05-06 22:36:23 +01:00
Alex Orlenko
5dc6c3214b
Prepare for 2024 edition
2025-05-06 21:28:21 +01:00
Alex Orlenko
39b3af2ff2
Fix warnings when testing documentation
2025-04-05 23:44:25 +01:00
Alex Orlenko
95c623e94d
Use c string literal where appropriate
2025-03-21 15:57:15 +00:00
Alex Orlenko
ea5ecccf02
Change AsyncThread<A, R> to AsyncThread<R>.
...
Push arguments in `Thread::into_async()` to the thread during the call instead of first poll.
The pushed arguments will be automatically used on resume.
Fixes #508 and relates to #500 .
2025-01-28 10:08:08 +00:00
Alex Orlenko
d8307d0e4c
Reduce visibility of Wrapped* structs
2024-11-22 13:08:57 +00:00
Alex Orlenko
93a1a55aaa
Update docs
2024-10-19 23:10:43 +01:00
Alex Orlenko
9f6c78532f
Move IntoLua/FromLua and IntoLuaMulti/FromLuaMulti to traits module
2024-10-07 10:32:50 +01:00
Alex Orlenko
f95161c6e0
Add missing documentation for Function::wrap_raw* functions
2024-10-05 23:26:03 +01:00
Alex Orlenko
4ac87c7208
Derive PartialEq instead of implementing manually
2024-10-02 12:21:04 +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
ca69be07ff
Support setting metatable for Lua builtin types.
...
Closes #445
2024-09-23 10:45:57 +01:00
Alex Orlenko
9931709ecd
Remove explicit lifetime from UserDataMethods and UserDataFields traits.
...
Pass `'static` arguments to async functions and require `'static` Future.
(in future we can use async closures to make it more elegant).
2024-08-23 00:10:29 +01:00
Alex Orlenko
c58f67b140
Add MaybeSend requirement to Lua futures
2024-08-10 17:55:39 +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
658f2a13ea
Support multi threads under send feature flag
2024-07-31 13:42:37 +01:00
Alex Orlenko
cd6d86a5ce
Split single lua module to multiple submodules under state
2024-07-31 13:42:37 +01:00
Alex Orlenko
d17dc54645
Rewrite call_async in traits to use impl Future instead of LocalBoxFuture.
...
More use `std::future` types instead of `future-utils`.
2024-07-31 13:42:36 +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
1eb2ecb3b0
Drop lifetime from IntoLua
2024-07-31 13:42:35 +01:00
Alex Orlenko
24b0672d99
Rename LuaRef to ValueRef
2024-07-31 13:42:35 +01:00
Alex Orlenko
08c7429531
Optimize various parts of the code to remove unnecessary clone calls.
...
This is became possible after implementing `IntoLua` for references.
2024-07-31 13:42:35 +01:00
Alex Orlenko
4aa178fcc0
Take &Value in Lua::push_value()
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
c36808b251
Faster Function::call() for lua51/jit/luau
2023-12-01 12:03:46 +00:00
Alex Orlenko
94a79656ad
Faster Function::call()
2023-08-03 01:16:52 +01:00
Alex Orlenko
cd0c8a4584
Optimize async functionality:
...
Rewrite using the new `push_into_stack()`/`from_stack()` methods.
Also store thread state (pointer) in `Thread` struct to avoid getting it every time.
Async userdata methods still need to have arguments stored in ref thread as stack is empty on every poll().
2023-08-03 00:56:17 +01:00
Alex Orlenko
196c09a0d6
New (unsafe and private) methods for IntoLua/FromLua traits: push_into_stack/from_stack.
...
They allow to push Value directly to Lua stack or get Value from Lua stack without creating MultiValue container.
This approach is a big optimization opportunity and already demonstrated great results.
For instance, obtaining `&T` for userdata methods are now work directly from stack value without copying to auxiliary stack.
2023-07-31 22:13:23 +01:00
Alex Orlenko
28bcc73f2c
Move impl IntoLua for WrappedFunction to the function.rs file
2023-07-27 15:19:34 +01:00
Alex Orlenko
9f5325ef2f
Use c-unwind ABI (Rust 1.71+)
2023-07-22 23:54:30 +01:00
Alex Orlenko
6b8b79266f
Drop futures-timer dev-dependency
2023-07-10 01:16:27 +01:00
Alex Orlenko
c38a1f060b
Various cosmetic changes
2023-07-10 00:04:40 +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
c1168d3ec1
Refactor call_async() functions to use static dispatch outside of traits
2023-06-21 12:44:24 +01:00
Alex Orlenko
cf0524aa23
Use lua_iscfunction instead of lua_getinfo in Function::environment()
2023-06-08 09:33:48 +01:00
Alex Orlenko
9596f2e9ee
Fix warning when compiling for lua51
2023-06-03 14:24:34 +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
baf25e263f
Change _mlua to __mlua prefix for internal chunk names
2023-05-30 00:36:09 +01:00