Crate openraft

source ·
Expand description

Openraft

§API status

Openraft API is currently unstable. Incompatibilities may arise in upgrades prior to 1.0.0. Refer to our Change-Log for details. Upgrade Guides explains how to upgrade.

Each commit message begins with a keyword indicating the type of change:

  • DataChange: Changes to on-disk data types, possibly requiring manual upgrade.
  • Change: Introduces incompatible API changes.
  • Feature: Adds compatible, non-breaking new features.
  • Fix: Addresses bug fixes.

§Openraft Document

If you’re starting to build an application with Openraft, check out

To maintain an Openraft cluster, e.g., add or remove nodes, refer to

When upgrading an Openraft application, consult:

To learn about the data structures used in Openraft and the commit protocol, see

Contributors who want to understand the internals of Openraft can find relevant information in

Finally, the archived and discarded documents:

Re-exports§

Modules§

  • async runtime interface.
  • This mod is a upgrade helper that provides functionalities for a newer openraft application to read data written by an older application.
  • Openraft Document
  • The default log entry type that implements RaftEntry.
  • Error types exposed by this crate.
  • Collection of implementations of usually used traits defined by Openraft
  • A trait for time instants.
  • This mod defines the identity of a raft log and provides supporting utilities to work with log id related types.
  • Raft metrics for observability.
  • The Raft network interface.
  • Public Raft interface and data types.
  • The Raft storage interface and data types.
  • Testing utilities for OpenRaft.

Macros§

Structs§

  • AnyError is a serializable wrapper Error.
  • An implementation of trait Node that contains minimal node information.
  • The runtime configuration for a Raft node.
  • An error that occurs when the RaftStore impl runs defensive check of input or output. E.g. re-applying an log entry is a violation that may be a potential bug.
  • The currently active membership config.
  • EmptyNode is an implementation of trait Node that contains nothing.
  • LeaderId is identifier of a leader.
  • The membership configuration of the cluster.
  • The state of membership configs a raft node needs to know.
  • A struct used to represent the raft state which a Raft node needs.
  • The identity of a segment of a snapshot.
  • Error that occurs when operating the store.
  • This struct represents information about a membership config that has already been stored in the raft logs.
  • Vote represent the privilege of a node.

Enums§

  • Defines various actions to change the membership, including adding or removing learners or voters.
  • Error variants related to configuration.
  • What it is doing when an error occurs.
  • All possible states of a Raft node.
  • Log compaction and snapshot policy.
  • A storage error could be either a defensive check error or an error occurred when doing the actual io operation.
  • Violations a store would return when running defensive check.

Traits§

Type Aliases§

  • The unique identifier of a leader that is already granted by a quorum in phase-1(voting).
  • Id of a snapshot stream.

Attribute Macros§

  • This proc macro attribute optionally adds Send bounds to a trait.