Skip to main content

Crate d_engine_core

Crate d_engine_core 

Source
Expand description

§d-engine-core

Pure Raft consensus algorithm - for building custom Raft-based systems

§⚠️ Internal Crate - Not Ready for Standalone Use

Use d-engine instead.

This crate contains the pure Raft consensus algorithm used internally by d-engine. The API is unstable before v1.0.

# ❌ Don't use this directly
[dependencies]
d-engine-core = "0.2"

# ✅ Use this instead
[dependencies]
d-engine = "0.2"

§For Contributors

§What this crate provides

This crate focuses solely on the Raft consensus algorithm:

  • Leader Election - Automatic leader election with randomized timeouts
  • Log Replication - Reliable log replication to followers
  • Membership Changes - Dynamic cluster membership changes
  • Snapshot Support - Log compaction via snapshots

Storage, networking, and state machine implementation are your responsibility.

Reference integration: See how d-engine-server uses this crate.

§Future Vision

Post-1.0 goal: Become a standalone Raft library with stable API.

Current status: Internal to d-engine, API may change between minor versions.

§Key Traits

§Documentation

For comprehensive guides:

Re-exports§

pub use client::*;
pub use command::*;
pub use config::*;
pub use storage::*;
pub use watch::*;

Modules§

client
Client abstractions for d-engine.
command
config
Configuration management module for distributed Raft consensus engine.
storage
watch
Watch mechanism for monitoring key changes

Structs§

LeaderInfo
Leader election information Used at: Application layer (internal Raft protocol notifications) Purpose: Notify applications about leader changes via watch channel Fields: Minimal - only what Raft protocol needs
Raft
SignalParams

Enums§

ConsensusError
Error
MembershipError
NetworkError
StorageError
SystemError

Traits§

Membership
PurgeExecutor
Defines the behavior for log entry compaction and physical deletion.
SnapshotPolicy
StateMachineHandler
Transport
TypeConfig

Type Aliases§

Result