rh_foundation/lib.rs
1//! Foundation crate providing common utilities and types shared across the workspace.
2//!
3//! This crate provides foundational functionality including:
4//! - Error handling (`error` module)
5//! - Configuration traits (`config` module)
6//! - I/O utilities (`io` module)
7//! - HTTP utilities (`http` module, with `http` feature)
8//! - JSON helpers (`json` module)
9//! - In-memory storage (`memory` module) - WASM-compatible caching
10//! - WASM utilities (`wasm` module, with `wasm` feature)
11//! - Package loading (`loader` module, with `http` feature)
12//! - Snapshot generation (`snapshot` module)
13//!
14//! # Features
15//! - `http`: Enables HTTP client utilities (requires `reqwest` and `tokio`)
16//! - `wasm`: Enables WebAssembly utilities (requires `wasm-bindgen`)
17#![cfg_attr(not(test), warn(clippy::unwrap_used))]
18
19#[cfg(not(target_arch = "wasm32"))]
20pub mod cli;
21pub mod config;
22pub mod error;
23#[cfg(not(target_arch = "wasm32"))]
24pub mod io;
25pub mod json;
26pub mod memory;
27pub mod snapshot;
28pub mod validation;
29
30#[cfg(feature = "http")]
31pub mod http;
32
33#[cfg(feature = "http")]
34pub mod loader;
35
36#[cfg(feature = "wasm")]
37pub mod wasm;
38
39// Re-export commonly used types
40pub use config::Config;
41pub use error::{ErrorContext, ErrorWithMetadata, FoundationError, Result};
42pub use memory::{MemoryStore, MemoryStoreConfig, MemoryStoreStats};
43pub use validation::{BindingStrength, ElementBinding, ElementCardinality, Invariant, Severity};