Expand description
§OpenRunner
A Rust library for running OpenScript code with fine-grained control over execution, I/O, environment, and process lifecycle.
§Features
- Run OpenScript code from Rust (string or file)
- Full async support with tokio
- Fine-grained control over I/O, environment, working directory, timeout, and more
- Spawn OpenScript processes for long-running jobs
- Convenience macros for quick scripting
- Designed to integrate seamlessly with OpenScript workflows
§Quick Start
use openrunner_rs::{run, ScriptOptions};
let options = ScriptOptions::new().openscript_path("/bin/sh");
let result = run(r#"echo "Hello from OpenRunner!""#, options).await?;
println!("Output: {}", result.stdout);
§Advanced Usage
use openrunner_rs::{run, ScriptOptions};
use std::time::Duration;
let options = ScriptOptions::new()
.openscript_path("/bin/sh")
.timeout(Duration::from_secs(30))
.env("MY_VAR", "custom_value")
.args(vec!["arg1".to_string(), "arg2".to_string()]);
let result = run("echo $MY_VAR $1 $2", options).await?;
println!("Result: {}", result.stdout);
Re-exports§
pub use error::Error;
pub use error::Result;
pub use runner::run;
pub use runner::run_file;
pub use runner::spawn;
pub use runner::spawn_file;
pub use types::ExecResult;
pub use types::ScriptOptions;
pub use types::SpawnResult;
Modules§
- error
- Error types for OpenRunner.
- macros
- Convenience macros for OpenRunner script execution.
- runner
- Core execution functions for running OpenScript code.
- types
- Type definitions for OpenRunner script execution.
Macros§
- run_
file_ script - Run an OpenScript file with optional configuration.
- run_
script - Run OpenScript code with optional configuration.
- spawn_
script - Spawn an OpenScript process with optional configuration.
Structs§
- Child
- Representation of a child process spawned onto an event loop.