Skip to main content

tsoracle_core/
lib.rs

1//
2//  ░▀█▀░█▀▀░█▀█░█▀▄░█▀█░█▀▀░█░░░█▀▀
3//  ░░█░░▀▀█░█░█░█▀▄░█▀█░█░░░█░░░█▀▀
4//  ░░▀░░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀
5//
6//  tsoracle — Distributed Timestamp Oracle
7//
8//  Copyright (c) 2026 Prisma Risk
9//  Licensed under the Apache License, Version 2.0
10//  https://github.com/prisma-risk/tsoracle
11//
12
13#![doc = include_str!("../README.md")]
14// Panic policy (see CONTRIBUTING.md). `cfg_attr(not(test), ...)` skips the lint
15// for the lib's own unit tests; integration tests are separate compilation units.
16#![cfg_attr(not(test), warn(clippy::unwrap_used, clippy::expect_used))]
17
18mod allocator;
19mod bt;
20mod clock;
21mod epoch;
22mod peer;
23mod timestamp;
24
25pub mod docs;
26
27pub use allocator::{Allocator, CommitOutcome, CoreError, IgnoreReason, WindowGrant};
28pub use bt::Bt;
29pub use clock::{Clock, SystemClock};
30pub use epoch::Epoch;
31pub use peer::TsoPeer;
32pub use timestamp::{LOGICAL_MAX, PHYSICAL_MS_MAX, Timestamp, TimestampError};
33
34#[cfg(any(test, feature = "test-clock"))]
35pub use clock::testing;