Skip to main content

tsoracle_server/
lib.rs

1//
2//  ░▀█▀░█▀▀░█▀█░█▀▄░█▀█░█▀▀░█░░░█▀▀
3//  ░░█░░▀▀█░█░█░█▀▄░█▀█░█░░░█░░░█▀▀
4//  ░░▀░░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀
5//
6//  tsoracle — Distributed Timestamp Oracle
7//  https://www.tsoracle.rs
8//
9//  Copyright (c) 2026 Prisma Risk
10//
11//  Licensed under the Apache License, Version 2.0 (the "License");
12//  you may not use this file except in compliance with the License.
13//  You may obtain a copy of the License at
14//
15//      https://www.apache.org/licenses/LICENSE-2.0
16//
17//  Unless required by applicable law or agreed to in writing, software
18//  distributed under the License is distributed on an "AS IS" BASIS,
19//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20//  See the License for the specific language governing permissions and
21//  limitations under the License.
22//
23
24#![doc = include_str!("../README.md")]
25// Panic policy (see CONTRIBUTING.md). `cfg_attr(not(test), ...)` skips the lint
26// for the lib's own unit tests; integration tests are separate compilation units.
27#![cfg_attr(not(test), warn(clippy::unwrap_used, clippy::expect_used))]
28
29mod bt;
30mod clock;
31mod fence;
32#[cfg(feature = "tracing")]
33pub(crate) mod heartbeat;
34mod leader_hint;
35mod lease_flow;
36mod persist_disposition;
37pub(crate) mod reporter;
38mod server;
39mod service;
40mod serving_core;
41mod signal;
42
43pub mod docs;
44
45pub use crate::reporter::Reporter;
46pub use bt::Bt;
47pub use clock::{Clock, SystemClock};
48pub use server::{BuildError, Server, ServerBuilder, ServerError, ServingState, WatchGuard};
49pub use signal::shutdown_signal;
50
51#[cfg(any(test, feature = "test-fakes"))]
52pub mod test_fakes;
53
54#[cfg(any(test, feature = "test-support"))]
55pub mod test_support;
56
57#[doc(hidden)]
58pub use leader_hint::decode_leader_hint as __priv_decode_leader_hint;