Documentation

Rust implementation of Heer and Stone's C3 library.

Loading data

  • C3::new / C3::try_new — Loads the same bundled c3_color.npy, c3_a.npy, and c3_t.npy via include_bytes! at compile time. Works on native and wasm32-unknown-unknown (browser): no runtime filesystem.
  • C3::from_embedded_npy — Same bytes, explicit Result API.
  • C3::from_npy_dir — Read .npy from disk (not available on wasm32-unknown-unknown; use WASI or embedded loaders instead).

The crates.io package ships those .npy files under src/ for reproducibility; dependents normally just call C3::try_new()?. without copying JSON or duplicating arrays.

Slice-oriented APIs

For JS interop or tight loops without ndarray::Array2:

Tests

cargo test

Optional regression run against on-disk .npy (must match the embedded bundle):

cargo test --test c3 -- --ignored

Benchmarks

cargo bench

Criterion writes reports under target/criterion/.

WASM CI

GitHub Actions runs cargo check --lib --target wasm32-unknown-unknown so browser builds stay compiling.