Skip to main content

hypercall_db/
lib.rs

1//! ORM-free domain types and persistence traits for Hypercall.
2//!
3//! This crate defines the public data types and Reader/Writer traits for the
4//! persistence layer. It has zero dependency on Diesel or any other ORM.
5//! The concrete implementation lives in `hypercall-db-diesel`, which converts
6//! its internal Diesel models into these types at the trait boundary.
7//!
8//! ## Consumer pattern
9//!
10//! Application code depends on trait bounds from this crate (e.g.
11//! `impl OrderReader`, `impl SettlementWriter`), never on concrete DB types.
12//! This keeps the engine, API handlers, and services testable with mock
13//! implementations.
14//!
15//! ## Modules
16//!
17//! - [`traits`] -- Reader/Writer/Transaction trait definitions, grouped by domain.
18//! - [`types`] -- ORM-free domain records and input structs, grouped by domain.
19
20pub mod journal_records;
21pub mod pnl_attribution;
22pub mod traits;
23pub mod types;
24
25// Re-export traits (Reader/Writer/Transaction interfaces)
26pub use traits::analytics::*;
27pub use traits::archiver::*;
28pub use traits::bootstrap::*;
29pub use traits::catalog::*;
30pub use traits::competition::*;
31pub use traits::directive_outbox::*;
32pub use traits::engine_journal::*;
33pub use traits::faucet::*;
34pub use traits::instruments::*;
35pub use traits::integrity::*;
36pub use traits::liquidation::*;
37pub use traits::mmp::*;
38pub use traits::nonces::*;
39pub use traits::notifications::*;
40pub use traits::oracle::*;
41pub use traits::orders::*;
42pub use traits::pm_settlement::*;
43pub use traits::push::*;
44pub use traits::replay::*;
45pub use traits::rfq::*;
46pub use traits::settlements::*;
47pub use traits::snapshots::*;
48pub use traits::tiers::*;
49pub use traits::transaction::*;
50pub use traits::usernames::*;
51#[cfg(feature = "rsm-state")]
52pub use traits::validator_rsm::*;
53
54// Re-export types (domain records and input structs)
55pub use journal_records::{JournalCommandSummary, JournalEventRecord, JournalFullRecord};
56pub use pnl_attribution::decode_pnl_attribution_values;
57pub use types::*;