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 timestamp;
23
24pub mod docs;
25
26pub use allocator::{Allocator, CoreError, WindowGrant};
27pub use bt::Bt;
28pub use clock::{Clock, SystemClock};
29pub use epoch::Epoch;
30pub use timestamp::{LOGICAL_MAX, PHYSICAL_MS_MAX, Timestamp, TimestampError};
31
32#[cfg(any(test, feature = "test-clock"))]
33pub use clock::testing;