Crates.io | rigz_lua |
lib.rs | rigz_lua |
version | 0.0.2 |
source | src |
created_at | 2024-05-11 02:57:53.552877 |
updated_at | 2024-06-22 06:41:39.627528 |
description | Lua Module for rigz language |
homepage | https://gitlab.com/inapinch/rigz/rigz/modules/crates/rigz_lua |
repository | https://gitlab.com/inapinch/rigz/rigz |
max_upload_size | |
id | 1236566 |
size | 18,505 |
The core module used for rigz currently, uses mlua to power the runtime.
cargo add rigz_lua
use std::collections::HashMap;
use std::path::PathBuf;
use rigz_lua::LuaModule;
fn main() {
let modules: HashMap<String, Box<dyn Module>> = HashMap::new();
let module_root: PathBuf = PathBuf::from("/path/to/module");
let source_files = vec![PathBuf::from("module/path/to/file.lua")];
let input_files: HashMap<String, Vec<File>> = HashMap::new();
let config: Option<serde_value::Value> = None;
let lua = LuaModule::new("hello_world", module_root, source_files, input_files, config);
modules.insert(lua.name(), lua)
}