Rust crate
The tetration crate provides read/write helpers for .tet files, a query engine, format conversion, and an optional C ABI for FFI bindings.
API documentation
Full type-level API reference: docs.rs/tetration
This site covers usage patterns and cookbooks. Prefer docs.rs for struct fields, trait bounds, and module listings.
What the crate provides
| Module | Role |
|---|---|
catalog | File layout, TetFile, TetWriterSession, packages, PackageStore |
query | JSON/TOML parse, plan, execute, materialize, store-backed execute |
convert | HDF5 / NetCDF / Zarr / NumPy / CSV / Parquet import |
export | Zarr / HDF5 / NetCDF export |
verify / repair | File health |
job | Job-file executor (run_job_path) — Job files |
ffi | C ABI behind tetration-ffi feature |
Install
bash
cargo add tetration
# optional S3Store / MinIO:
cargo add tetration --features tetration-s3Requires Rust 1.95+. Current crates.io line: 0.8.3 (see version alignment).
Sections
- Quick start — minimal read example
- Open & inspect — catalog access, dataset iteration
- Chunk reads — mmap and partial read patterns
- Store-backed reads —
PackageStore,S3Store, URI pin, range planner - Write path — creating
.tetfiles programmatically - C ABI / FFI — overview for binding authors
Embedder flow
- Write —
TetWriterSession::create→push_datasetwithTetDatasetWrite::f32_row_major,f64_row_major, orrow_major(dtype, …)→commit(). Streaming grids useTetDatasetStreamSpec(same builders) andcommit_with_fill. - Read / aggregate —
TetFile::open→execute_query_json→QueryResponse - Dense tensors —
materialize_query_selectionormaterialize_query_transform_ram→DenseMaterializeOutcome
Examples in the repo
bash
cargo run --example create_and_query
cargo run --example session_write
cargo run --example inspect_catalog