...
This commit is contained in:
37
packages/system/virt/src/rhai.rs
Normal file
37
packages/system/virt/src/rhai.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
//! Rhai wrappers for Virt module functions
|
||||
//!
|
||||
//! This module provides Rhai wrappers for the functions in the Virt module,
|
||||
//! including Buildah, Nerdctl, and RFS functionality.
|
||||
|
||||
use rhai::{Engine, EvalAltResult};
|
||||
|
||||
pub mod buildah;
|
||||
pub mod nerdctl;
|
||||
pub mod rfs;
|
||||
|
||||
/// Register all Virt module functions with the Rhai engine
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `engine` - The Rhai engine to register the functions with
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// * `Result<(), Box<EvalAltResult>>` - Ok if registration was successful, Err otherwise
|
||||
pub fn register_virt_module(engine: &mut Engine) -> Result<(), Box<EvalAltResult>> {
|
||||
// Register Buildah module functions
|
||||
buildah::register_bah_module(engine)?;
|
||||
|
||||
// Register Nerdctl module functions
|
||||
nerdctl::register_nerdctl_module(engine)?;
|
||||
|
||||
// Register RFS module functions
|
||||
rfs::register_rfs_module(engine)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Re-export main functions for convenience
|
||||
pub use buildah::{bah_new, register_bah_module};
|
||||
pub use nerdctl::register_nerdctl_module;
|
||||
pub use rfs::register_rfs_module;
|
Reference in New Issue
Block a user