J.A.R.V.I.S-rust/crates/jarvis-core/src/lua.rs

28 lines
526 B
Rust
Raw Normal View History

mod engine;
mod sandbox;
mod error;
mod api;
mod structs;
pub use structs::*;
pub use engine::LuaEngine;
pub use sandbox::SandboxLevel;
pub use error::LuaError;
use std::path::PathBuf;
use std::time::Duration;
#[cfg(test)]
mod tests;
// Execute a Lua command script
pub fn execute(
script_path: &PathBuf,
context: CommandContext,
sandbox: SandboxLevel,
timeout: Duration,
) -> Result<CommandResult, LuaError> {
let engine = LuaEngine::new(sandbox)?;
engine.execute(script_path, context, timeout)
}