Skip to main content

taceo_oprf/
lib.rs

1#![deny(missing_docs)]
2//! # TACEO:OPRF Umbrella Crate
3//!
4//! `taceo-oprf` bundles all TACEO:OPRF sub-crates into a single crate
5//! so you can include only the features you need, without importing
6//! each crate separately.
7//!
8//! ## Modules
9//!
10//! - [`client`] – high-level OPRF client functionality (requires the `client` feature).
11//! - [`core`] – core OPRF primitives and cryptography (requires the `core` feature).
12//! - [`dev_client`] – developer-focused client utilities for testing and mocking
13//!   (requires the `dev-client` feature, implies `client`).
14//! - [`service`] – OPRF service nodes, background tasks, and orchestration
15//!   (requires the `service` feature).
16//! - [`types`] – shared types and structs across OPRF crates
17//!   (requires the `types` feature).
18//! - [`anvil`] – test helpers for deploying the OPRF contracts to a local
19//!   Anvil devnet (requires the `anvil` feature; not included in `full`).
20//!
21//! ## Features
22//!
23//! Each module is optional. Enable only the modules you need to reduce
24//! compile time and dependencies.
25//!
26//! ```toml
27//! [dependencies]
28//! taceo-oprf = { version = "0.7.1", features = ["client", "core"] }
29//! ```
30//!
31//! The feature `full` enables all modules with their transitive deps (except the test feature `anvil`).
32//!
33//! ### Transitive sub-crate features
34//!
35//! The umbrella forwards each sub-crate feature as its own flag so consumers
36//! can opt in or out without importing the individual crates. All of these use
37//! the weak-dependency syntax (`dep?/feature`) and therefore do **not** activate
38//! the parent crate on their own — the corresponding crate-selection feature
39//! (`core`, `service`, `types`) must also be enabled.
40//!
41//! | Umbrella feature | Forwarded to            | Notes                               |
42//! |------------------|-------------------------|-------------------------------------|
43//! | `postgres`       | `oprf-service/postgres` | On by default via `full`            |
44//! | `chain`          | `oprf-types/chain`      | On by default via `full`            |
45//!
46//! The `anvil` feature is not forwarded from a sub-crate; it enables the
47//! [`anvil`] module directly and pulls in `alloy`, `eyre`, and `serde_json`.
48//! It is opt-in only and, unlike the modules above, is **not** enabled by
49//! `full`.
50
51#[cfg(feature = "client")]
52/// Re-export of the `taceo-oprf-client` crate.
53pub mod client {
54    pub use oprf_client::*;
55}
56
57#[cfg(feature = "core")]
58/// Re-export of the `taceo-oprf-core` crate.
59pub mod core {
60    pub use oprf_core::*;
61}
62
63#[cfg(feature = "dev-client")]
64/// Re-export of the `taceo-oprf-dev-client` crate.
65/// Requires the `client` feature.
66pub mod dev_client {
67    pub use oprf_dev_client::*;
68}
69
70#[cfg(feature = "service")]
71/// Re-export of the `taceo-oprf-service` crate.
72pub mod service {
73    pub use oprf_service::*;
74}
75
76#[cfg(feature = "types")]
77/// Re-export of the `taceo-oprf-types` crate.
78pub mod types {
79    pub use oprf_types::*;
80}
81
82#[cfg(feature = "anvil")]
83pub mod anvil;