summaryrefslogtreecommitdiff
path: root/tests/userdata.rs
AgeCommit message (Collapse)Author
2023-08-27Fix setting userdata (static) fields when it has __index metamethod/function.Alex Orlenko
Closes #312
2023-08-24Fix an edge case when using invalidated (relative) userdata index after ↵Alex Orlenko
processing varargs. This causes Lua API correctness check assertion in debug mode. Fixes #311.
2023-07-26Fix lua51/52 case in userdata testsAlex Orlenko
2023-07-26Set `__type` metatable field for Luau instead of `__name`.Alex Orlenko
Other Lua versions continue to use `__name` field. Also make `MetaMethod` enum non-exhaustive (and add `Type` variant) Closes #295
2023-07-16Add `#[derive(FromLua)]` macro to opt-in into `FromLua<T> where T: 'static + ↵Alex Orlenko
Clone` (userdata type). Future macro implementations will allow making T from Lua tables/other values. Relates to #291.
2023-07-10Add `AnyUserData::wrap()` to more easy way of creating _any_ userdata in Lua.Alex Orlenko
This is similar to `Function::wrap()`.
2023-07-09Rename `AnyUserData::get_*_user_value` to `AnyUserData::*_user_value`.Alex Orlenko
To be more consistent with function like `Lua::named_registry_value`, `Lua::add_data_ref` and os on.
2023-06-21impl UserData for Rc<T> and Arc<T> where T: UserDataAlex Orlenko
2023-06-07Add `UserDataFields::add_field()` method to add static fields to UserData.Alex Orlenko
Plus `UserDataFields::add_meta_field()` for static meta fields. Fix propagating fields to wrapped UserData types.
2023-05-25Set `__name` field in userdata metatable if not providedAlex Orlenko
2023-05-03Add `OwnedAnyUserData::take()`Alex Orlenko
2023-04-26Various improvements for owned types, including:Alex Orlenko
- tests - shortcuts for `OwnedFunction` and `OwnedAnyUserData`
2023-03-14Improve error reporting when calling Rust functions from Lua.Alex Orlenko
In particular new error type `Error::BadArgument` added to help identify bad argument position or name (eg `self` for userdata).
2023-02-26Add `UserDataRef` and `UserDataRefMut` types that implement `FromLua`Alex Orlenko
and can be used as accessors to underlying `AnyUserData` type.
2023-02-18Add `AnyUserDataExt` trait with auxiliary functions for `AnyUserData`Alex Orlenko
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
2023-01-06Rename `to_lua_err` -> `into_lua_err`Alex Orlenko
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-20Remove FromLua impl for UserData+CloneAlex 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-12-18Do not clear usevalues when taking value out of userdata.Alex Orlenko
It has big performance penalty. Lua GC can collect uservalues when userdata is not referenced anymore.
2022-06-28Add Lua::create_proxy for easy access to UserData static fields and functionsAlex Orlenko
Closes #178
2022-04-16Add parking_lot dependency and featureSondre Aasemoen
2022-03-20Initial Luau supportAlex Orlenko
2021-11-21Add `get_named_user_value` and `set_named_user_value` to `AnyUserData`Alex 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 luajit52 support (LuaJIT with partial compatibility with Lua 5.2)Alex Orlenko
2021-10-05Add (hidden) method `UserData::take()` to take out value from userdataAlex Orlenko
2021-06-19More tests for arc/rc wrapped userdataAlex Orlenko
2021-06-17Improve code coverageAlex Orlenko
2021-06-03Implement `UserData` for Rc<RefCell>/Arc<Mutex>/Arc<RwLock> wrappersAlex Orlenko
2021-04-27More testsAlex Orlenko
2021-04-27Make MetaMethod::name() publicAlex Orlenko
Tests for UserDataMetatable::pairs()
2021-04-27Add `UserDataFields` API.Alex Orlenko
Provide safe access to UserData metatable and allow to define custom metamethods..
2021-04-16Drop 'feature(link_args)' (removed from nightly). Don't run tests for LuaJIT ↵Alex Orlenko
2.0.5
2021-03-03Fix compilation warnings on nightlyAlex Orlenko
2020-06-06Add `has_metamethod` to `AnyUserData`Alex Orlenko
2020-06-06Add LuaJIT 2.0.5 stable supportAlex Orlenko
2020-05-12Add MetaMethod::Close to support Lua 5.4 to-be-closed variablesAlex Orlenko
2020-05-11Add Lua 5.4 (rc2) supportAlex Orlenko
2020-05-11Add Send capability to LuaAlex Orlenko
2020-04-17v0.3.0-alpha.1 with async supportAlex Orlenko
Squashed commit of the async branch.
2020-01-25Remove `__ipairs` metamethod deprecated in lua 5.3 and not available by defaultAlex Orlenko
2020-01-25Support vendored versions of Lua and LuaJITAlex Orlenko
2020-01-07Implement PartialEq trait for Value (and subtypes)Alex Orlenko
Add equals() method to compare values optionally invoking __eq.
2019-11-30Add pair and ipair metamethods support (lua 5.2/5.3 only)Alex Orlenko
2019-11-04Add LuaJIT supportAlex Orlenko
2019-10-17Lua 5.1 supportAlex Orlenko
2019-10-01Rename to mluaAlex Orlenko
2019-09-29Update tests (excl. compile-fail)Alex Orlenko