tsoracle_driver_openraft/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
29pub mod capabilities;
30pub mod driver;
31pub mod host;
32pub mod log_codec;
33pub mod log_entry;
34pub mod observability;
35pub mod snapshot_store;
36pub mod standalone;
37pub mod state_machine;
38pub mod type_config;
39
40/// The default immutable genesis cardinality cap for dense sequence keys.
41/// Every cluster member must be constructed with the same value; the cap is
42/// stored in replicated snapshots so replay/restore reproduces the same
43/// accept/reject decisions (spec §6.2). Operators that need a larger or
44/// smaller key namespace configure this at SM construction time.
45pub const DEFAULT_DENSE_CARDINALITY_CAP: u64 = 10_000;
46
47pub use capabilities::{
48 CapabilitySource, FormatActivationError, NodeCapabilities, all_members_can_read, gather_with,
49 report_with,
50};
51pub use driver::OpenraftDriver;
52pub use host::OpenraftHighWaterHost;
53pub use log_codec::OpenraftLogCodec;
54pub use log_entry::{DenseAdvance, HighWaterCommand, SetFormatVersionPayload};
55#[cfg(feature = "rocksdb-snapshot-store")]
56pub use snapshot_store::RocksdbSnapshotStore;
57pub use snapshot_store::{InMemorySnapshotStore, SnapshotStore};
58pub use standalone::StandaloneHost;
59pub use state_machine::{HighWaterStateMachine, HighWaterStateMachineSnapshot};
60/// Re-export of the cross-backend advance payload that [`HighWaterCommand::Advance`]
61/// wraps, so consumers can build commands without depending on `tsoracle-consensus`.
62pub use tsoracle_consensus::AdvancePayload;
63pub use tsoracle_core::TsoPeer;
64pub use type_config::{
65 ApplyOutcome, HighWaterApplied, OpenraftEntry, OpenraftLogId, OpenraftPeer, OpenraftVote,
66 ServiceEndpoint, TypeConfig,
67};