25 lines
469 B
Rust
Raw Normal View History

2024-09-17 17:16:57 -07:00
pub struct Runner{
lua:mlua::Lua,
2024-09-16 18:54:04 -07:00
}
2024-09-17 17:16:57 -07:00
fn init(lua:&mlua::Lua)->mlua::Result<()>{
2024-09-16 19:01:16 -07:00
Ok(())
2024-09-16 18:54:04 -07:00
}
2024-09-17 17:16:57 -07:00
impl Runner{
pub fn new()->mlua::Result<Self>{
let runner=Self{
lua:mlua::Lua::new(),
};
init(&runner.lua)?;
Ok(runner)
}
pub fn set_script(&self,script:rbx_dom_weak::types::Ref)->mlua::Result<()>{
Ok(())
}
pub fn run(&self,source:String,context:&mut crate::context::Context)->mlua::Result<()>{
//Set up dom access here?
self.lua.load(source).exec()
}
}