mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-24 08:11:04 +00:00
15 lines
285 B
Rust
15 lines
285 B
Rust
use mlua::Lua;
|
|
|
|
pub struct Runner {
|
|
pub(super) setter: fn(&Lua) -> mlua::Result<()>,
|
|
}
|
|
|
|
impl Runner {
|
|
pub fn spawn(&self, name: &str) -> mlua::Result<Lua> {
|
|
let lua = Lua::new();
|
|
lua.set_app_data(yazi_binding::Runtime::new_isolate(name));
|
|
|
|
(self.setter)(&lua)?;
|
|
Ok(lua)
|
|
}
|
|
}
|