Reference
The public API
Generated straight from pkg.generated.mbti — the interface
moon info emits and the 723-test suite pins.
58 types · 300 methods ·
30 free functions.
Start with RaftNode (message-driven) or Cluster (the batteries-included simulator). RawNode is the Ready/Advance driver a real deployment runs.
Functions & constants
committed_index(Array[String], Array[String], Map[String, UInt64]) → UInt64vote_result(Array[String], Array[String], Map[String, Bool]) → VoteStatereplicate(Node, Array[Node]) → UInt64run_election(Node, Array[Node]) → Boolrun_single_node(String, Array[Bytes]) → Array[Bytes]
describe(Array[String], Map[String, UInt64]) → Stringentry_encoding_size(Entry) → UInt64ents_size(ArrayView[Entry]) → UInt64hard_state_equal(HardState, HardState) → Boollimit_size(ArrayView[Entry], UInt64) → Array[Entry]no_limit : UInt64payload_size(Entry) → UInt64payloads_size(ArrayView[Entry]) → UInt64describe_conf_state(@raftpb.ConfState) → Stringdescribe_entries(ArrayView[@raftpb.Entry], ((Bytes) -> String)?) → Stringdescribe_entry(@raftpb.Entry, ((Bytes) -> String)?) → Stringdescribe_hard_state(@raftpb.HardState) → Stringdescribe_snapshot(@raftpb.Snapshot) → Stringmust_sync(@raftpb.HardState, @raftpb.HardState, Int) → Bool
demo_report_lines(DemoReport) → Array[String]demo_run(Array[String], UInt64, Int, Int, Int) → DemoReportwnode_campaign() → Unitwnode_drain() → Stringwnode_new(Int, Int, Int) → Unitwnode_propose(Int) → Unitwnode_recv_apply() → Unitwnode_recv_push(Int) → Unitwnode_recv_reset() → Unitwnode_state() → Stringwnode_tick() → Unit
RaftNode
structThe message-driven consensus server: timers, campaigns, and the tick / step surface a transport drives.
core : Nodeid : Stringpeers : Array[String]config : @confchange.Membershipprogress : Map[String, @tracker.Progress]votes : Map[String, Bool]mut pre_vote : Boolmut check_quorum : Boolmut in_pre_campaign : Boolmut leader_id : String?mut election_elapsed : Intmut heartbeat_elapsed : Intelection_timeout : Intheartbeat_timeout : Intmut randomized_election_timeout : Intmax_msg_bytes : UInt64max_uncommitted_size : UInt64mut uncommitted_size : UInt64max_inflight : Intmax_inflight_bytes : UInt64mut rng : UInt64mut conf_applied : UInt64mut lead_transferee : String?read_only : ReadOnlypending_read_index : Array[(String, Bytes)]mut no_forward : Boolmut pending_conf_index : UInt64no_conf_change_validation : Boolstep_down_on_removal : Boolpending_farewell : Array[@raftpb.Message]logger : &Loggertracer : &Tracer
advance_applied(Self, UInt64) → Unitbecome_candidate(Self) → Unitbecome_follower(Self, UInt64) → Unitcampaign(Self) → Array[@raftpb.Message]commit_index(Self) → UInt64conf_state(Self) → @raftpb.ConfStatedisable_proposal_forwarding(Self) → Unitelection_deadline(Self) → Intenable_check_quorum(Self) → Unitenable_read_only_safe(Self) → Unitforget_leader(Self) → Unitfrom_config(Config) → Self raise ConfigErrorfull_status(Self) → FullStatushas_lease(Self) → Boolid(Self) → Stringis_leader(Self) → Boolleader(Self) → String?new(String, Array[String], seed? : UInt64, election_timeout? : Int, heartbeat_timeout? : Int, max_msg_bytes? : UInt64, max_uncommitted_size? : UInt64, max_inflight? : Int, max_inflight_bytes? : UInt64, check_quorum? : Bool, pre_vote? : Bool, step_down_on_removal? : Bool, disable_conf_change_validation? : Bool, read_only_option? : ReadOnlyOption, logger? : &Logger, tracer? : &Tracer) → Selfnode(Self) → Nodeprogress_of(Self, String) → ProgressStatus?progress_status(Self) → Array[ProgressStatus]promotable(Self) → Boolpropose(Self, Bytes) → Array[@raftpb.Message]propose_conf(Self, @confchange.ConfChange) → Array[@raftpb.Message]propose_conf_v2(Self, @confchange.ConfChangeV2) → Array[@raftpb.Message]quorum_active(Self) → Boolraw(Self) → RawNoderaw_async(Self) → RawNoderaw_async_sized(Self, UInt64) → RawNoderaw_with_max_committed_size(Self, UInt64) → RawNoderead_index(Self) → UInt64?read_only_option(Self) → ReadOnlyOptionreduce_uncommitted_size(Self, UInt64) → Unitreport_snapshot(Self, String, Bool) → Unitreport_unreachable(Self, String) → Unitrequest_read_index(Self, Bytes) → Array[@raftpb.Message]request_transfer_leader(Self, String) → Array[@raftpb.Message]role(Self) → Roleset_pre_vote(Self, Bool) → Unitset_read_only_option(Self, ReadOnlyOption) → Unitsoft_state(Self) → SoftStatestatus(Self) → RaftStatusstep(Self, @raftpb.Message) → Array[@raftpb.Message]take_read_states(Self) → Array[ReadState]term(Self) → UInt64tick(Self) → Array[@raftpb.Message]transfer_leadership(Self, String) → Array[@raftpb.Message]uncommitted_size(Self) → UInt64voter_nodes(Self) → Array[String]with_progress(Self, (String, ProgressStatus) -> Unit) → Unit
RawNode
structThe synchronous Ready/Advance driver over a RaftNode — the batch a real deployment persists, sends, and applies.
raft : RaftNodemut log : @log.RaftLogmax_committed : UInt64msgs : Array[@raftpb.Message]read_states : Array[ReadState]mut prev_soft : SoftStatemut prev_hard : @raftpb.HardStatemut async_storage : Boolmut reflected_snap : UInt64
advance(Self, Ready) → Unitapply_conf_change(Self, @confchange.ConfChange) → Array[String]basic_status(Self) → RaftStatuscampaign(Self) → Unitconf_state(Self) → @raftpb.ConfStateforget_leader(Self) → Unitfull_status(Self) → FullStatushas_ready(Self) → Boolis_async(Self) → Boolnew(RaftNode) → Selfnew_sized(RaftNode, UInt64) → Selfnext_unstable_snapshot(Self) → @raftpb.Snapshot?node(Self) → RaftNodepropose(Self, Bytes) → Unitpropose_conf(Self, @confchange.ConfChange) → Unitpropose_conf_v2(Self, @confchange.ConfChangeV2) → Unitread_index(Self, Bytes) → Unitready(Self) → Readyready_without_accept(Self) → Readyreport_snapshot(Self, String, Bool) → Unitreport_unreachable(Self, String) → Unitstabilize(Self) → Array[@raftpb.Message]status(Self) → RaftStatusstep(Self, @raftpb.Message) → Unitstep_append_resp(Self, StorageAppendResp) → Unitstep_apply_resp(Self, StorageApplyResp) → Unitstore(Self, Ready) → Unittick(Self) → Unittransfer_leader(Self, String) → Unitwith_progress(Self, (String, ProgressStatus) -> Unit) → Unit
Ready
structOne batch of outstanding work: state changes, entries to persist, committed entries to apply, and messages to send.
soft_state : SoftState?hard_state : @raftpb.HardState?read_states : Array[ReadState]entries : Array[@raftpb.Entry]snapshot : @raftpb.Snapshot?committed_entries : Array[@raftpb.Entry]messages : Array[@raftpb.Message]must_sync : Boolstorage_append : StorageAppend?storage_apply : StorageApply?
Message
structA routed message — a sender, a recipient, and a Payload. The unit a transport moves without interpreting.
from : Stringto : Stringpayload : Payloadforce : Bool
is_response(Self) → Boolkind(Self) → Stringnew(String, String, Payload, force? : Bool) → Selfterm(Self) → UInt64
Cluster
structThe deterministic, single-seed simulator: drop, delay, reorder, partition, crash — with safety-invariant checks.
nodes : Map[String, RaftNode]ids : Array[String]mut inflight : Array[InFlight]mut now : Intpart : Map[String, Int]down : Map[String, Bool]mut drop_permil : Intmut max_delay : Intmut next_group : Intmut rng : UInt64
all_committed(Self, UInt64) → Boolcommitted_agrees(Self) → Boolcompact_leader(Self, UInt64, Bytes) → Boolcrash(Self, String) → Unitenable_check_quorum(Self) → Unitheal(Self) → Unitinvariants_hold(Self) → Boolis_down(Self, String) → Boolisolate(Self, String) → Unitleader(Self) → String?leaders(Self) → Array[String]logs_consistent(Self) → Boolnew(Array[String], seed? : UInt64) → Selfnode(Self, String) → RaftNodeone_leader_per_term(Self) → Boolpartition(Self, Array[String], Array[String]) → Unitpropose(Self, Bytes) → Boolpropose_conf(Self, @confchange.ConfChange) → Boolpropose_on(Self, String, Bytes) → Boolrestart(Self, String) → Unitrun(Self, Int) → Unitrun_until_committed(Self, UInt64, Int) → Boolrun_until_leader(Self, Int) → String?same_committed_commands(Self) → Boolset_delay(Self, Int) → Unitset_drop(Self, Int) → Unittick(Self) → Unittransfer_leadership(Self, String) → Bool
Node
structThe consensus core state and role transitions the RaftNode wraps.
id : Stringmut role : Rolemut current_term : UInt64mut voted_for : String?log : Array[@raftpb.Entry]mut commit_index : UInt64mut last_applied : UInt64mut snapshot_index : UInt64mut snapshot_term : UInt64
advance_commit(Self, UInt64) → Unitappend(Self, UInt64, Bytes) → @raftpb.Entryappend_conf(Self, UInt64, Bytes) → @raftpb.Entryapply_committed(Self, &StateMachine) → Unitapply_hard_state(Self, @raftpb.HardState) → Unitbecome_candidate(Self) → Unitbecome_follower(Self, UInt64) → Unitbecome_leader(Self) → Unitbecome_pre_candidate(Self) → Unitcompact(Self, UInt64, Bytes, conf_state? : @raftpb.ConfState) → @raftpb.Snapshotcurrent_term(Self) → UInt64entries_after(Self, UInt64) → Array[@raftpb.Entry]entries_after_limited(Self, UInt64, UInt64) → Array[@raftpb.Entry]entry_at(Self, UInt64) → @raftpb.Entry?find_conflict_by_term(Self, UInt64, UInt64) → (UInt64, UInt64)handle_append_entries(Self, @raftpb.AppendEntriesArgs) → @raftpb.AppendEntriesReplyhandle_install_snapshot(Self, @raftpb.InstallSnapshotArgs) → @raftpb.InstallSnapshotReplyhandle_request_vote(Self, @raftpb.RequestVoteArgs) → @raftpb.RequestVoteReplyhard_state(Self) → @raftpb.HardStateinstall_snapshot(Self, @raftpb.Snapshot) → Unitlast_log_index(Self) → UInt64last_log_term(Self) → UInt64load_from(Self, &@storage.RaftStorage) → Unitlog_len(Self) → Intmark_applied(Self, UInt64) → Unitnew(String) → Selfpersisted(Self) → @storage.Persistedpropose_conf_change(Self, UInt64, @confchange.ConfChange) → @raftpb.Entryrecover(Self, @storage.Persisted) → Unitrecover_from(Self, &@storage.WalStore) → Unitreplay(Self, Array[@storage.WalRecord]) → Unitrequest_vote_args(Self) → @raftpb.RequestVoteArgsrole(Self) → Rolesave_into(Self, @storage.MemoryStorage) → Unitsave_to(Self, &@storage.WalStore) → Unitterm_at(Self, UInt64) → UInt64
RaftStatus
structderive(Eq)A point-in-time snapshot of a server's observable state, for monitoring and tests.
id : Stringrole : Roleterm : UInt64leader : String?commit : UInt64last_index : UInt64applied : UInt64
describe(Self) → String
AppendEntriesArgs
structderive(Eq)term : UInt64leader_id : Stringprev_log_index : UInt64prev_log_term : UInt64entries : Array[Entry]leader_commit : UInt64
AppendEntriesReply
structderive(Eq)term : UInt64success : Boolmatch_index : UInt64conflict_index : UInt64conflict_term : UInt64reject_index : UInt64
Changer
structmut cfg : ChangerConfigmut prs : Map[String, @tracker.Progress]mut last_index : UInt64max_inflight : Intmax_inflight_bytes : UInt64
advance_index(Self) → Unitconf_state(Self) → @raftpb.ConfStatedescribe(Self) → Stringenter_joint(Self, Bool, Array[(String, String)]) → String?leave_joint(Self) → String?new(last_index? : UInt64, max_inflight? : Int, max_inflight_bytes? : UInt64) → Selfrestore(Self, @raftpb.ConfState) → String?simple(Self, Array[(String, String)]) → String?
ChangerConfig
structincoming : Array[String]outgoing : Array[String]learners : Array[String]learners_next : Array[String]mut auto_leave : Bool
ConfChange
structderive(Eq)change_type : ConfChangeTypenode_id : String
add(String) → Selfadd_learner(String) → Selfapply_to(Self, Membership) → Unitdecode(Bytes) → Self?encode(Self) → Bytesremove(String) → Self
ConfChangeTransition
enumderive(Eq)AutoJointImplicitJointExplicit
ConfChangeType
enumderive(Eq)AddNodeRemoveNodeAddLearnerNode
ConfChangeV2
structderive(Eq)changes : Array[ConfChange]transition : ConfChangeTransition
auto(Array[ConfChange]) → Selfauto_leave(Self) → Booldecode(Bytes) → Self?encode(Self) → Bytesenter_joint(Array[ConfChange], auto_leave? : Bool) → Selfenters_joint(Self) → (Bool, Bool)is_leave(Self) → Boolleave_joint() → Self
ConfDriver
structconfig : @confchange.Membershipmut applied : UInt64
config(Self) → @confchange.Membershipdrive(Self, Node) → Intnew(Array[String]) → Self
ConfState
structderive(Eq)voters : Array[String]learners : Array[String]voters_outgoing : Array[String]learners_next : Array[String]auto_leave : Bool
empty() → Selfequivalent(Self, Self) → Boolis_empty(Self) → Bool
Config
structid : Stringpeers : Array[String]election_tick : Intheartbeat_tick : Intmax_msg_bytes : UInt64max_uncommitted_size : UInt64max_inflight : Intmax_inflight_bytes : UInt64check_quorum : Boolpre_vote : Boolread_only_option : ReadOnlyOptionstep_down_on_removal : Booldisable_proposal_forwarding : Booldisable_conf_change_validation : Boolapplied : UInt64logger : &Loggertracer : &Tracerseed : UInt64
new(String, Array[String], election_tick? : Int, heartbeat_tick? : Int, max_msg_bytes? : UInt64, max_uncommitted_size? : UInt64, max_inflight? : Int, max_inflight_bytes? : UInt64, check_quorum? : Bool, pre_vote? : Bool, read_only_option? : ReadOnlyOption, step_down_on_removal? : Bool, disable_proposal_forwarding? : Bool, disable_conf_change_validation? : Bool, applied? : UInt64, logger? : &Logger, tracer? : &Tracer, seed? : UInt64) → Selfvalidate(Self) → Unit raise ConfigError
DemoReport
structseed : UInt64node_count : Intfirst_leader : String?proposal_accepted : Boolcommitted : Boolsecond_leader : String?one_leader_per_term : Boolcommitted_agrees : Boolinvariants_hold : Bool
Entry
structderive(Eq)term : UInt64index : UInt64entry_type : EntryTypecommand : Bytes
conf(UInt64, UInt64, Bytes) → Selfid(Self) → EntryIdis_conf_change(Self) → Boolnormal(UInt64, UInt64, Bytes) → Self
EntryId
structderive(Eq)term : UInt64index : UInt64
EntryType
enumderive(Eq)NormalConfChange
FullStatus
structbasic : RaftStatusprogress : Array[ProgressStatus]config : @raftpb.ConfState
HardState
structderive(Eq)term : UInt64vote : String?commit : UInt64
initial() → Selfis_empty(Self) → Bool
HeartbeatArgs
structderive(Eq)term : UInt64leader_id : Stringcommit : UInt64context : Bytes
HeartbeatReply
structderive(Eq)term : UInt64context : Bytes
Inflight
structderive(Eq)mut index : UInt64mut bytes : UInt64
Inflights
structmut start : Intmut count : Intmut bytes : UInt64size : Intmax_bytes : UInt64mut buffer : Array[Inflight]
add(Self, UInt64, UInt64) → Unitclone(Self) → Selfcount(Self) → Intfree_le(Self, UInt64) → Unitfull(Self) → Boolmax_bytes(Self) → UInt64new(Int, UInt64) → Selfreset(Self) → Unit
InstallSnapshotArgs
structderive(Eq)term : UInt64leader_id : Stringlast_index : UInt64last_term : UInt64offset : UInt64data : Bytesdone : Boolconf_state : ConfState
whole(UInt64, String, Snapshot) → Self
InstallSnapshotReply
structderive(Eq)term : UInt64
LogLevel
enumderive(Eq)DebugInfoWarningErrorFatalPanic
LogSlice
structterm : UInt64prev : @raftpb.EntryIdentries : Array[@raftpb.Entry]
last_entry_id(Self) → @raftpb.EntryIdlast_index(Self) → UInt64valid(Self) → Bool
Membership
structmembers : Array[String]outgoing : Array[String]mut joint : Boollearners : Array[String]learners_next : Array[String]mut auto_leave : Bool
add(Self, String) → Unitadd_learner(Self, String) → Unitbegin_joint(Self, Array[String]) → Unitcommitted_index(Self, Map[String, UInt64]) → UInt64contains(Self, String) → Boolenter_joint(Self, Array[String]) → Unithas_majority(Self, Array[String]) → Boolis_joint(Self) → Boolis_learner(Self, String) → Boolleave_joint(Self) → Unitnew(Array[String]) → Selfnodes(Self) → Array[String]quorum(Self) → Intremove(Self, String) → Unitsize(Self) → Intvote_result(Self, Map[String, Bool]) → @quorum.VoteStatevoters(Self) → Array[String]
MemoryStorage
structmut hard : @raftpb.HardStatemut snap : @raftpb.Snapshotmut ents : Array[@raftpb.Entry]mut snapshot_pending : Bool
append(Self, Array[@raftpb.Entry]) → Unitapply_snapshot(Self, @raftpb.Snapshot) → Unit raise StorageErrorcompact(Self, UInt64) → Unit raise StorageErrorcreate_snapshot(Self, UInt64, Bytes, conf_state? : @raftpb.ConfState?) → @raftpb.Snapshot raise StorageErrorfrom_ents(Array[@raftpb.Entry]) → Selfnew() → Selfraw_ents(Self) → Array[@raftpb.Entry]seed_snapshot(Self, @raftpb.Snapshot) → Unitset_hard_state(Self, @raftpb.HardState) → Unitset_snapshot_pending(Self, Bool) → Unitslice(Self, UInt64, UInt64) → Array[@raftpb.Entry]
NopLogger
structNopTracer
structPayload
enumPreVote(RequestVoteArgs)PreVoteResp(RequestVoteReply)Vote(RequestVoteArgs)VoteResp(RequestVoteReply)Append(AppendEntriesArgs)AppendResp(AppendEntriesReply)Heartbeat(HeartbeatArgs)HeartbeatResp(HeartbeatReply)Snapshot(InstallSnapshotArgs)TimeoutNow(UInt64)Propose(Array[Entry])ReadIndex(Bytes)ReadIndexResp(ReadIndexResp)TransferLeader(String)ForgetLeader
is_local(Self) → Bool
Persisted
structterm : UInt64voted_for : String?log : Array[@raftpb.Entry]
Progress
structmut next_index : UInt64mut match_index : UInt64mut state : ProgressStatemut recent_active : Boolmut msg_app_flow_paused : Boolmut pending_snapshot : UInt64mut is_learner : Boolmut sent_commit : UInt64inflights : Inflights
become_probe(Self) → Unitbecome_replicate(Self) → Unitbecome_snapshot(Self, UInt64) → Unitcan_bump_commit(Self, UInt64) → Boolcopy(Self) → Selffree_le(Self, UInt64) → Unitis_active(Self) → Boolis_paused(Self) → Boolmark_active(Self) → Unitmaybe_decr_to(Self, UInt64, UInt64) → Boolmaybe_decrease(Self, UInt64) → Boolmaybe_update(Self, UInt64) → Boolnew(UInt64, max_inflight? : Int, max_inflight_bytes? : UInt64) → Selfnote_commit_sent(Self, UInt64) → Unitoptimistic_advance(Self, UInt64) → Unitreset_active(Self) → Unitsent_entries(Self, UInt64, Bool, bytes? : UInt64) → Unitto_string(Self) → Stringunpause(Self) → Unit
ProgressState
enumderive(Eq)ProbeReplicateSnapshot
ProgressStatus
structderive(Eq)id : Stringmatch_index : UInt64next_index : UInt64state : @tracker.ProgressStatepaused : Boolpending_snapshot : UInt64is_learner : Bool
RaftLog
structstorage : &@storage.RaftStorageunstable : Unstablemut committed : UInt64mut applying : UInt64mut applied : UInt64max_applying_ents_size : UInt64mut applying_ents_size : UInt64mut applying_ents_paused : Bool
accept_applying(Self, UInt64, UInt64, Bool) → Unitaccept_unstable(Self) → Unitall_entries(Self) → Array[@raftpb.Entry]append(Self, Array[@raftpb.Entry]) → UInt64applied_to(Self, UInt64, UInt64) → Unitasync_stabilize(Self, UInt64, UInt64) → Unitcommit_stable(Self, Array[@raftpb.Entry]) → Unitcommit_to(Self, UInt64) → Unitcommitted(Self) → UInt64entries(Self, UInt64, UInt64) → Array[@raftpb.Entry] raise LogCompactedfind_conflict(Self, ArrayView[@raftpb.Entry]) → UInt64find_conflict_by_term(Self, UInt64, UInt64) → (UInt64, UInt64)first_index(Self) → UInt64has_next_committed_ents(Self, Bool) → Boolhas_next_or_in_progress_unstable_ents(Self) → Boolhas_next_unstable_ents(Self) → Boolhas_next_unstable_snapshot(Self) → Boolis_up_to_date(Self, @raftpb.EntryId) → Boollast_entry_id(Self) → @raftpb.EntryIdlast_index(Self) → UInt64match_term(Self, @raftpb.EntryId) → Boolmaybe_append(Self, LogSlice, UInt64) → UInt64?maybe_commit(Self, @raftpb.EntryId) → Boolmust_check_out_of_bounds(Self, UInt64, UInt64) → Unit raise LogCompactednew(@storage.MemoryStorage) → Selfnew_with_size(&@storage.RaftStorage, UInt64) → Selfnext_committed_ents(Self, Bool) → Array[@raftpb.Entry]next_unstable_ents(Self) → Array[@raftpb.Entry]next_unstable_snapshot(Self) → @raftpb.Snapshot?pending_snapshot_index(Self) → UInt64?restore(Self, @raftpb.Snapshot) → Unitscan(Self, UInt64, UInt64, UInt64, (ArrayView[@raftpb.Entry]) -> Unit raise) → Unit raiseseed(Self, UInt64, UInt64) → Unitslice(Self, UInt64, UInt64, UInt64) → Array[@raftpb.Entry] raise LogCompactedsnapshot(Self) → @raftpb.Snapshot raise @storage.StorageErrorstable_snap_to(Self, UInt64) → Unitstable_to(Self, @raftpb.EntryId) → Unitterm(Self, UInt64) → UInt64 raise @storage.StorageErrorto_string(Self) → Stringzero_term_on_out_of_bounds(Self, UInt64) → UInt64
ReadIndexResp
structderive(Eq)term : UInt64index : UInt64context : Bytes
ReadOnlyOption
enumderive(Eq)SafeLeaseBased
ReadState
structderive(Eq)index : UInt64request_ctx : Bytes
RequestVoteArgs
structderive(Eq)term : UInt64candidate_id : Stringlast_log_index : UInt64last_log_term : UInt64
RequestVoteReply
structderive(Eq)term : UInt64vote_granted : Bool
Role
enumderive(Eq)FollowerPreCandidateCandidateLeader
Snapshot
structderive(Eq)last_index : UInt64last_term : UInt64data : Bytesconf_state : ConfState
empty() → Selfis_empty(Self) → Bool
SoftState
structderive(Eq)lead : String?state : Role
equal(Self, Self) → Bool
StorageAppend
structentries : Array[@raftpb.Entry]hard_state : @raftpb.HardState?snapshot : @raftpb.Snapshot?resp : StorageAppendResp
StorageAppendResp
structderive(Eq)index : UInt64log_term : UInt64term : UInt64
StorageApply
structentries : Array[@raftpb.Entry]resp : StorageApplyResp
StorageApplyResp
structentries : Array[@raftpb.Entry]
TraceEvent
enumInitState(String)StateChange(String, Role, UInt64)Commit(String, UInt64)Replicate(String, Array[@raftpb.Entry])SendMessage(@raftpb.Message)ReceiveMessage(@raftpb.Message)ConfChange(String, @raftpb.ConfState)
Unstable
structmut snapshot : @raftpb.Snapshot?mut entries : Array[@raftpb.Entry]mut offset : UInt64mut offset_in_progress : UInt64mut snapshot_in_progress : Bool
accept_in_progress(Self) → Unitmaybe_first_index(Self) → UInt64?maybe_last_index(Self) → UInt64?maybe_term(Self, UInt64) → UInt64?new(UInt64) → Selfnext_entries(Self) → Array[@raftpb.Entry]next_snapshot(Self) → @raftpb.Snapshot?restore(Self, @raftpb.Snapshot) → Unitslice(Self, UInt64, UInt64) → Array[@raftpb.Entry]stable_snap_to(Self, UInt64) → Unitstable_to(Self, @raftpb.EntryId) → Unittruncate_and_append(Self, Array[@raftpb.Entry]) → Unit
VoteState
enumderive(Eq)VoteWonVoteLostVotePending
WalRecord
enumderive(Eq)WalHardState(@raftpb.HardState)WalEntry(@raftpb.Entry)WalSnapshot(@raftpb.Snapshot)