pub enum Error{ Lua(mlua::Error), } pub struct Runner{ source:String, } impl Runner{ pub const fn new(source:String)->Self{ Self{source} } pub fn run(self,context:&mut crate::context::Context)->Result<(),Error>{ let lua=mlua::Lua::new(); lua.sandbox(true).map_err(Error::Lua)?; lua.load(self.source).exec().map_err(Error::Lua)?; Ok(()) } }