-
I have an app that consists of a Rust CLI binary that includes a mlua based Lua interpreter. It also distributes quite a number of Lua and other resource files. I would like to embed all the Lua resource files into the Rust binary so the app can function as a stand alone binary, but at the same time I would like the existing Lua code to function as-is with I've used My question is if anybody has accomplished or can think of a way to accomplish something similar with mlua such that the Lua |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
It should be simple I think, you need to register your own package searcher with required priority. |
Beta Was this translation helpful? Give feedback.
-
I think I'm most of the way there with a loader for Lua modules that finds them in the embedded asset cache. However this works for Lua modules and I'm having conniptions figuring out how to do it for C modules. I can embed them just fine and get them back as bytes, but I can't figure out how to load the result into Lua. I see the Any ideas? |
Beta Was this translation helpful? Give feedback.
The 1st variant should work actually (or very close to). Take a look to the code below, it works fine. No need to do wrap/unwrap/etc.