Skip to main content

apache_datasketches/
lib.rs

1//! Safe, idiomatic Rust bindings for [Apache DataSketches](https://github.com/apache/datasketches-cpp),
2//! built via the `cxx` crate over the raw
3//! [`apache-datasketches-sys`](https://docs.rs/apache-datasketches-sys) bridge.
4//!
5//! `default = []` — no sketch family is compiled in unless you opt into its
6//! Cargo feature explicitly:
7//!
8//! - `hll` (feature `hll`) — HyperLogLog cardinality estimation (sketch +
9//!   union).
10//! - `theta` (feature `theta`) — cardinality estimation plus set
11//!   operations: union, intersection, a-not-b, and Jaccard similarity.
12//! - `cpc` (feature `cpc`) — Compressed Probabilistic Counting
13//!   cardinality estimation with a more compact serialized form (sketch +
14//!   union only; no set operations beyond union).
15//! - `tuple` (feature `tuple`) — Tuple sketches, in two shapes. The
16//!   ArrayOfDoubles form carries a fixed-width array of `f64` per distinct
17//!   key (summed on collision); the generic form in `tuple::generic` carries
18//!   a summary type you define in Rust. Both support union, intersection,
19//!   a-not-b, and Jaccard similarity.
20//!
21//! (Module-level docs for each feature are only linked above when built
22//! with that feature enabled — see `hll`/`theta`/`cpc`/`tuple` in the
23//! sidebar, or build with `--all-features` to see all four at once.)
24//!
25//! See each module's documentation for usage examples, or the crate's
26//! `examples/` directory for complete runnable demos.
27
28#![warn(missing_docs)]
29
30pub mod error;
31
32#[cfg(feature = "hll")]
33pub mod hll;
34
35#[cfg(feature = "theta")]
36pub mod theta;
37
38#[cfg(feature = "cpc")]
39pub mod cpc;
40
41#[cfg(feature = "tuple")]
42pub mod tuple;
43
44pub use error::SketchError;