Support new Luau require system

This commit introduces the `Require` trait that be used to change `require` behaviour.
By default mlua implements behaviour same as `ReplRequirer` in the original Luau.
Unfortunately binary Luau modules are no longer supported by the new system.
This commit is contained in:
Alex Orlenko
2025-04-25 14:19:41 +01:00
parent 117f8377e2
commit 560a30ca02
44 changed files with 757 additions and 385 deletions
+2
View File
@@ -41,6 +41,8 @@ impl StdLib {
pub const MATH: StdLib = StdLib(1 << 7);
/// [`package`](https://www.lua.org/manual/5.4/manual.html#6.3) library
#[cfg(not(feature = "luau"))]
#[cfg_attr(docsrs, doc(cfg(not(feature = "luau"))))]
pub const PACKAGE: StdLib = StdLib(1 << 8);
/// [`buffer`](https://luau.org/library#buffer-library) library