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, or a future I/O adapter)
7//! supply time, transport, storage, and seeds, which is what makes the
8//! whole cluster reproducible from a single seed.
9//!
10//! Implemented at M1: leader election with Pre-Vote, log replication
11//! with conflict-term fast backup, monotonic match tracking, and
12//! persist-before-response ordering. M2 added the Figure 8 commitment
13//! suite, `ReadIndex`, and client deduplication. M3 adds snapshots,
14//! chunked `InstallSnapshot`, and single-server membership changes.
15//!
16//! This crate is strictly std-only (DECISIONS Q5) and forbids unsafe
17//! code.
18
19#![forbid(unsafe_code)]
20#![warn(missing_docs)]
21
22pub mod action;
23pub mod config;
24pub mod error;
25pub mod event;
26pub mod ids;
27pub mod log;
28pub mod membership;
29pub mod message;
30pub mod node;
31pub mod snapshot;
32
33pub use action::{Action, ClientResult, ConfigResult};
34pub use config::Config;
35pub use error::{ConfigError, ProtocolError, SnapshotError};
36pub use event::{Event, HardState, PersistKind};
37pub use ids::{ClientId, LogIndex, NodeId, Term, Tick};
38pub use log::{EntryKind, Log, LogEntry};
39pub use membership::{ClusterConfig, ConfigChange, ConfigState};
40pub use message::Message;
41pub use node::{Node, Role};
42pub use snapshot::SnapshotMeta;