pub enum RaftEvent {
Show 17 variants
ReceiveVoteRequest(VoteRequest, MaybeCloneOneshotSender<Result<VoteResponse, Status>>),
ClusterConf(MetadataRequest, MaybeCloneOneshotSender<Result<ClusterMembership, Status>>),
ClusterConfUpdate(ClusterConfChangeRequest, MaybeCloneOneshotSender<Result<ClusterConfUpdateResponse, Status>>),
AppendEntries(AppendEntriesRequest, MaybeCloneOneshotSender<Result<AppendEntriesResponse, Status>>),
InstallSnapshotChunk(Box<Streaming<SnapshotChunk>>, MaybeCloneOneshotSender<Result<SnapshotResponse, Status>>),
StreamSnapshot(Box<Streaming<SnapshotAck>>, StreamResponseSender),
JoinCluster(JoinRequest, MaybeCloneOneshotSender<Result<JoinResponse, Status>>),
DiscoverLeader(LeaderDiscoveryRequest, MaybeCloneOneshotSender<Result<LeaderDiscoveryResponse, Status>>),
TriggerSnapshotPush {
peer_id: u32,
},
CreateSnapshotEvent,
LogPurgeCompleted(LogId),
SnapshotCreated(Result<(SnapshotMetadata, PathBuf)>),
PromoteReadyLearners,
StepDownSelfRemoved,
MembershipApplied,
FatalError {
source: String,
error: String,
},
ApplyCompleted {
last_index: u64,
results: Vec<ApplyResult>,
},
}Variants§
ReceiveVoteRequest(VoteRequest, MaybeCloneOneshotSender<Result<VoteResponse, Status>>)
ClusterConf(MetadataRequest, MaybeCloneOneshotSender<Result<ClusterMembership, Status>>)
ClusterConfUpdate(ClusterConfChangeRequest, MaybeCloneOneshotSender<Result<ClusterConfUpdateResponse, Status>>)
AppendEntries(AppendEntriesRequest, MaybeCloneOneshotSender<Result<AppendEntriesResponse, Status>>)
InstallSnapshotChunk(Box<Streaming<SnapshotChunk>>, MaybeCloneOneshotSender<Result<SnapshotResponse, Status>>)
StreamSnapshot(Box<Streaming<SnapshotAck>>, StreamResponseSender)
JoinCluster(JoinRequest, MaybeCloneOneshotSender<Result<JoinResponse, Status>>)
DiscoverLeader(LeaderDiscoveryRequest, MaybeCloneOneshotSender<Result<LeaderDiscoveryResponse, Status>>)
TriggerSnapshotPush
CreateSnapshotEvent
LogPurgeCompleted(LogId)
SnapshotCreated(Result<(SnapshotMetadata, PathBuf)>)
PromoteReadyLearners
StepDownSelfRemoved
Node removed itself from cluster membership Leader must step down immediately after self-removal per Raft protocol
MembershipApplied
Membership change has been applied to state Leader should refresh cluster metadata cache
FatalError
State machine apply failed - node must shutdown. Conservative: treat all SM errors as fatal (future: distinguish fatal vs application errors).
ApplyCompleted
State machine apply completed Sent by CommitHandler after applying entries to state machine Contains results for each applied entry (e.g., CAS success/failure)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RaftEvent
impl !RefUnwindSafe for RaftEvent
impl Send for RaftEvent
impl !Sync for RaftEvent
impl Unpin for RaftEvent
impl UnsafeUnpin for RaftEvent
impl !UnwindSafe for RaftEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request