herolib_rust/src/lib.rs
Mahmoud-Emad 6dead402a2
Some checks are pending
Rhai Tests / Run Rhai Tests (push) Waiting to run
feat: Remove herodo from monorepo and update dependencies
- Removed the `herodo` binary from the monorepo. This was
  done as part of the monorepo conversion process.
- Updated the `Cargo.toml` file to reflect the removal of
  `herodo` and adjust dependencies accordingly.
- Updated `src/lib.rs` and `src/rhai/mod.rs` to use the new
  `sal-vault` crate for vault functionality.  This improves
  the modularity and maintainability of the project.
2025-06-23 14:56:03 +03:00

67 lines
1.6 KiB
Rust

//! # System Abstraction Layer (SAL)
//!
//! `sal` is a library that provides a unified interface for interacting with
//! operating system features across different platforms. It abstracts away the
//! platform-specific details, allowing developers to write cross-platform code
//! with ease.
//!
//! ## Features
//!
//! - File system operations
//! - Process management
//! - System information
//! - Network operations
//! - Environment variables
//! - Cryptographic operations
use std::io;
use thiserror::Error;
/// Error types for the SAL library
#[derive(Error, Debug)]
pub enum Error {
/// An error occurred during an I/O operation
#[error("I/O error: {0}")]
Io(#[from] io::Error),
/// An error specific to the SAL library
#[error("SAL error: {0}")]
Sal(String),
/// An error that occurred in a platform-specific operation
#[error("Platform-specific error: {0}")]
Platform(String),
}
/// Result type for SAL operations
pub type Result<T> = std::result::Result<T, Error>;
// Re-export modules
pub use sal_mycelium as mycelium;
pub use sal_net as net;
pub use sal_os as os;
pub use sal_postgresclient as postgresclient;
pub use sal_process as process;
pub use sal_redisclient as redisclient;
pub mod rhai;
pub use sal_text as text;
pub use sal_vault as vault;
pub use sal_virt as virt;
pub use sal_zinit_client as zinit_client;
// Version information
/// Returns the version of the SAL library
pub fn version() -> &'static str {
env!("CARGO_PKG_VERSION")
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_version() {
assert!(!version().is_empty());
}
}