Alex Orlenko
4aa178fcc0
Take &Value in Lua::push_value()
2024-07-31 13:42:35 +01:00
Alex Orlenko
98ca880f8a
Change Value::Error variant to store Box<Error> instead of Error.
...
This will help to reduce size of `Value` enum on the stack.
2024-07-31 13:42:34 +01:00
Alex Orlenko
c23fa5aa6c
Optimize RegistryKey internals
...
- Store single `AtomicI32` field instead of pair i32,AtomicBool
- Make creation faster by skipping intermediate `Value` layer
Add new `RegistryKey::id()` method to return underlying identifier
2024-06-18 16:09:06 +01:00
Alex Orlenko
a644049087
Cosmetic changes for clippy
2024-04-05 12:44:18 +01:00
Alex Orlenko
f67f8646ae
Implement push_into_stack/from_stack for Option<T>
2024-03-28 18:18:08 +00:00
Alex Orlenko
fa217d3706
Better Luau buffer type support.
...
- Add `Lua::create_buffer()` function
- Support serializing buffer type as a byte slice
- Support accessing copy of underlying bytes using `BString`
2024-03-28 13:05:01 +00:00
Yiyu Lin
b62f2ee0f7
chore: make clippy happy ( #388 )
...
Co-authored-by: hzlinyiyu <hzlinyiyu@corp.netease.com >
2024-03-25 13:26:06 +00:00
Alex Orlenko
83c075c72b
Implement IntoLua for RegistryKey
2024-02-29 22:45:32 +00:00
Alex Orlenko
020e8a78a8
Impl FromLua for RegistryKey
2024-02-10 15:41:48 +00:00
Alex Orlenko
3ca7b4942e
Implement IntoLua for &Value
2024-02-07 00:10:49 +00:00
Alex Orlenko
1754226c74
Impl IntoLua::push_into_stack for integers
2024-02-03 21:32:49 +00:00
Alex Orlenko
f5982bc204
Add inline to FromLua<bool>::from_stack
2024-01-27 14:40:32 +00:00
Alex Orlenko
512921404c
Add fastpath push_into_stack/from_stack methods for bool type
2024-01-26 14:07:56 +00:00
Alex Orlenko
df778b7b33
Impl Into/FromLua for OwnedString
2024-01-25 18:04:55 +00:00
Alex Orlenko
2ac7b23596
Impl Into/FromLua for OwnedThread
2024-01-25 09:34:37 +00:00
Alex Orlenko
8200bee467
Implement IntoLua for ref to String/Table/Function/AnyUserData
...
This would prevent cloning plus has better performance when pushing values to Lua stack (`IntoLua::push_into_stack` method)
2024-01-23 22:14:50 +00:00
Alex Orlenko
727f99ee4d
Implement IntoLua for &RegistryKey
...
This would allow just passing registry keys to arguments with fasttrack to push directly into stack.
2024-01-20 22:04:28 +00:00
Alex Orlenko
5043447f23
Support Luau buffer type and and library.
...
Buffer is an object that represents a fixed-size mutable block of memory and added to Luau 0.601.
See https://luau-lang.org/library#buffer-library for more details.
2023-11-16 12:55:58 +00:00
Alex Orlenko
c062cddd87
Fastpath IntoLua/FromLua for StdString and &str
...
This includes direct push to Lua stack and getting value from Lua stack.
2023-08-03 10:02:20 +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
7dc6e4c132
Add Error::runtime() helper
2023-07-10 22:41:03 +01:00
Alex Orlenko
c38a1f060b
Various cosmetic changes
2023-07-10 00:04:40 +01:00
Alex Orlenko
b169031d4e
Don't use any metamethods in Table::sequence_values() iterator.
...
This is matches with `Table::pair()` iterator.
Remove `Table::raw_sequence_values()` iterator.
2023-06-26 10:46:59 +01:00
Alex Orlenko
1f0e81c9a1
Add a dedicated type for Luau vector.
...
Refactor existing implementation and add 4-dimensional vectors support.
2023-06-20 13:30:42 +01:00
Alex Orlenko
0fccdfed5c
Fix feature flags for owned types
2023-04-14 01:17:26 +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
68b60e2a0a
Add UserDataRef and UserDataRefMut types that implement FromLua
...
and can be used as accessors to underlying `AnyUserData` type.
2023-02-26 21:52:28 +00: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
61c285746c
Remove FromLua impl for UserData+Clone
2022-12-20 23:30:18 +00:00
Alex Orlenko
a13c188de3
Rename ToLua/ToLuaMulti -> IntoLua/IntoLuaMulti
2022-12-19 23:00:47 +00:00
Alex Orlenko
c60f633a62
Add "unstable" feature flag.
...
Hide owned types under the new feature flag.
Drop OwnedString/OwnedThread types (unlikely they are useful).
2022-12-19 22:26:44 +00:00
Alex Orlenko
bf79d9e75d
Initial implementation of owned Lua types
2022-12-18 00:35:41 +00:00
Alex Orlenko
a05a58b258
Update integer/number coercion logic
2022-05-30 19:26:12 +01:00
Alex Orlenko
99becdb590
More inline attributes
2022-05-29 20:17:09 +01:00
Alex Orlenko
3a9c8c2da2
Add Luau vector datatype support
2022-03-22 21:14:06 +00:00
Alex Orlenko
1b74c89509
More performance optimizations
2021-11-25 11:16:12 +00:00
Alex Orlenko
d0641d812f
Refactor a bit conversion int->number
2021-11-04 13:15:26 +00:00
Alex Orlenko
d88a4282c7
Replace macro-based implementation ToLua for arrays to const generics
2021-11-04 00:59:39 +00:00
Alex Orlenko
c8c64a1b5a
Add serializing i128/u128 types.
...
Fixes #81 .
2021-10-04 23:20:11 +01:00
Alex Orlenko
ee1c8a1a3d
Add inline attributes to few hot funcs
2021-09-28 16:19:29 +01:00
Alex Orlenko
24bbd62564
Fix converting Lua sequence table to HashSet/BTreeSet
2021-06-25 01:49:09 +01:00
Alex Orlenko
2250421438
Fix clippy warnings
2021-05-04 23:42:33 +01:00
Alex Orlenko
4af7bcf0d9
Implement ToLua/FromLua for Box<str> and Box<[T]>
2021-05-03 12:22:11 +01:00
Alex Orlenko
1d9cda10eb
Add ToLua implementation for Cow<str> and Cow<CStr>
2021-02-26 10:23:36 +00:00
Alex Orlenko
b6ff501b8c
Fix numeric types conversion for 32bit lua. Fix #27
2021-01-20 10:46:23 +00:00
Kai Schmidt
c65058a40a
impl ToLua and FromLua for HashSet and BTreeSet
2020-09-27 17:54:47 -07:00
Alex Orlenko
79bfb112aa
Remove redundant lifetimes
2020-05-15 01:48:57 +01:00
Alex Orlenko
9f2d598517
Add clippy check and fix clippy warnings
2020-05-15 01:48:56 +01:00
Alex Orlenko
d366ce0dd4
Scope support (including async)
2020-05-11 02:43:34 +01:00
Alex Orlenko
2bd5c2f6ca
Hide Lua "Send" capability under the optional "send" feature flag
2020-05-11 02:43:34 +01:00