Skip to main content

dgen_data/
lib.rs

1// src/lib.rs
2//
3// SPDX-License-Identifier: MIT OR Apache-2.0
4
5//! High-performance random data generation with controllable deduplication and compression
6//!
7//! This library provides:
8//! - Xoshiro256++ RNG for high-speed data generation (5-15 GB/s per core)
9//! - Controllable deduplication ratios (1:1 to N:1)
10//! - Controllable compression ratios (1:1 to N:1)
11//! - NUMA-aware parallel generation (optional)
12//! - Zero-copy Python bindings via PyO3
13
14// Core modules
15pub mod constants;
16pub mod generator;
17
18#[cfg(feature = "numa")]
19pub mod numa;
20
21// Python bindings
22#[cfg(feature = "python-bindings")]
23mod python_api;
24
25// Re-export main API
26pub use generator::{
27    generate_data, generate_data_simple, DataGenerator, GeneratorConfig, NumaMode,
28};
29
30#[cfg(feature = "numa")]
31pub use numa::{NumaNode, NumaTopology};
32
33// PyO3 module initialization
34#[cfg(feature = "python-bindings")]
35use pyo3::prelude::*;
36
37#[cfg(feature = "python-bindings")]
38#[pymodule]
39fn _dgen_rs(m: &Bound<'_, PyModule>) -> PyResult<()> {
40    // Register all Python functions
41    python_api::register_functions(m)?;
42    Ok(())
43}