Skip to main content

tinyquant_io/
lib.rs

1//! Serialization, mmap, and file I/O for `TinyQuant`.
2//!
3//! This crate provides:
4//!
5//! - [`compressed_vector::to_bytes`] — encode a [`tinyquant_core::codec::CompressedVector`]
6//!   to the Level-1 binary wire format.
7//! - [`compressed_vector::from_bytes`] — decode from the wire format.
8//! - [`errors::IoError`] — error type for all I/O operations.
9//! - [`zero_copy::CompressedVectorView`] — zero-copy view of a Level-1 record.
10//! - [`codec_file`] — Level-2 TQCV corpus file container.
11#![deny(
12    warnings,
13    missing_docs,
14    unsafe_op_in_unsafe_fn,
15    clippy::all,
16    clippy::pedantic,
17    clippy::nursery,
18    clippy::unwrap_used,
19    clippy::expect_used,
20    clippy::panic,
21    clippy::indexing_slicing,
22    clippy::cognitive_complexity
23)]
24#![allow(clippy::module_name_repetitions, clippy::must_use_candidate)]
25
26pub mod codec_file;
27pub mod compressed_vector;
28pub mod errors;
29#[cfg(feature = "rayon")]
30pub mod parallelism;
31pub mod zero_copy;
32
33#[cfg(feature = "mmap")]
34pub mod mmap;
35
36pub use compressed_vector::{from_bytes, to_bytes};
37pub use zero_copy::CompressedVectorView;