simraft_core/lib.rs
1//! simraft-core: a pure sans-I/O Raft consensus state machine.
2//!
3//! A [`Node`] consumes [`Event`] values and returns [`Action`] values.
4//! It reads no clock, opens no socket, touches no disk, spawns no
5//! thread, and draws no randomness from the operating system. Drivers
6//! (the deterministic simulator in `simraft-sim` and the TCP/file
7//! adapter in `simraft-node`) supply time, transport, storage, and
8//! seeds, which is what makes the whole cluster reproducible from a
9//! single seed.
10//!
11//! Protocol features: leader election with Pre-Vote, log replication
12//! with conflict-term fast backup, monotonic match tracking,
13//! persist-before-response ordering, Figure 8 commitment, clock-free
14//! linearizable reads via `ReadIndex`, in-flight client deduplication,
15//! snapshots with chunked `InstallSnapshot` transfer, and single-server
16//! membership changes.
17//!
18//! This crate depends only on `std` and forbids unsafe code.
19
20#![forbid(unsafe_code)]
21#![warn(missing_docs)]
22
23pub mod action;
24pub mod config;
25pub mod error;
26pub mod event;
27pub mod ids;
28pub mod log;
29pub mod membership;
30pub mod message;
31pub mod node;
32pub mod snapshot;
33
34pub use action::{Action, ClientResult, ConfigResult};
35pub use config::Config;
36pub use error::{ConfigError, ProtocolError, SnapshotError};
37pub use event::{Event, HardState, PersistKind};
38pub use ids::{ClientId, LogIndex, NodeId, Term, Tick};
39pub use log::{EntryKind, Log, LogEntry};
40pub use membership::{ClusterConfig, ConfigChange, ConfigState};
41pub use message::Message;
42pub use node::{Node, NodeStats, PeerStats, Role};
43pub use snapshot::SnapshotMeta;