1.1 KiB
1.1 KiB
Rhai Script Commands Documentation
This documentation provides detailed information about the Rhai script commands available in the SAL library. The commands are organized by module for easy reference.
Modules
- OS Module - File system operations, directory management, and download functions
- Process Module - Command execution and process management
- Buildah Module - Container and image management
Overview
The SAL library provides integration with the Rhai scripting language, allowing you to use powerful system functions within your Rhai scripts. These functions are organized into modules that provide related functionality.
Using Rhai in Your Projects
To use these commands in your Rhai scripts, you need to register the SAL modules with your Rhai engine:
use rhai::Engine;
use sal::rhai;
let mut engine = Engine::new();
rhai::register(&mut engine);
// Now you can use SAL functions in Rhai scripts
let result = engine.eval::<bool>("exist('some_file.txt')").unwrap();
This will register all available modules (OS, Process, and Buildah) with your Rhai engine.