tsoracle-driver-openraft 2.2.1

openraft-backed ConsensusDriver for tsoracle
Documentation
//
//  ░▀█▀░█▀▀░█▀█░█▀▄░█▀█░█▀▀░█░░░█▀▀
//  ░░█░░▀▀█░█░█░█▀▄░█▀█░█░░░█░░░█▀▀
//  ░░▀░░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀
//
//  tsoracle — Distributed Timestamp Oracle
//  https://www.tsoracle.rs
//
//  Copyright (c) 2026 Prisma Risk
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      https://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//

#![doc = include_str!("../README.md")]
// Panic policy (see CONTRIBUTING.md). `cfg_attr(not(test), ...)` skips the lint
// for the lib's own unit tests; integration tests are separate compilation units.
#![cfg_attr(not(test), warn(clippy::unwrap_used, clippy::expect_used))]

pub mod capabilities;
pub mod driver;
pub mod host;
pub mod log_codec;
pub mod log_entry;
pub mod observability;
pub mod snapshot_store;
pub mod standalone;
pub mod state_machine;
pub mod type_config;

/// The default immutable genesis cardinality cap for dense sequence keys.
/// Every cluster member must be constructed with the same value; the cap is
/// stored in replicated snapshots so replay/restore reproduces the same
/// accept/reject decisions (spec §6.2). Operators that need a larger or
/// smaller key namespace configure this at SM construction time.
pub const DEFAULT_DENSE_CARDINALITY_CAP: u64 = 10_000;

pub use capabilities::{
    CapabilitySource, FormatActivationError, NodeCapabilities, all_members_can_read, gather_with,
    report_with,
};
pub use driver::OpenraftDriver;
pub use host::OpenraftHighWaterHost;
pub use log_codec::OpenraftLogCodec;
pub use log_entry::{DenseAdvance, HighWaterCommand, SetFormatVersionPayload};
#[cfg(feature = "rocksdb-snapshot-store")]
pub use snapshot_store::RocksdbSnapshotStore;
pub use snapshot_store::{InMemorySnapshotStore, SnapshotStore};
pub use standalone::StandaloneHost;
pub use state_machine::{HighWaterStateMachine, HighWaterStateMachineSnapshot};
/// Re-export of the cross-backend advance payload that [`HighWaterCommand::Advance`]
/// wraps, so consumers can build commands without depending on `tsoracle-consensus`.
pub use tsoracle_consensus::AdvancePayload;
pub use tsoracle_core::TsoPeer;
pub use type_config::{
    ApplyOutcome, HighWaterApplied, OpenraftEntry, OpenraftLogId, OpenraftPeer, OpenraftVote,
    ServiceEndpoint, TypeConfig,
};