pub enum ProtocolMessage {
Handshake {
node_name: String,
group_name: String,
node_type: NodeType,
},
HandshakeResponse {
accepted: bool,
reason: Option<String>,
},
Heartbeat {
master_vlsn: u64,
timestamp_ms: u64,
},
HeartbeatResponse {
replica_vlsn: u64,
timestamp_ms: u64,
},
LogEntry {
vlsn: u64,
entry_type: u8,
data: Vec<u8>,
},
Ack {
vlsn: u64,
},
GroupChange {
change_type: GroupChangeType,
node: RepNode,
},
GroupChangeResponse {
accepted: bool,
},
ElectionProposal {
node_name: String,
vlsn: u64,
priority: u32,
term: u64,
dtvlsn: u64,
},
ElectionVote {
voter: String,
granted: bool,
term: u64,
},
ElectionResult {
master: String,
term: u64,
},
Shutdown {
reason: String,
},
}Expand description
A message in the replication protocol.
These messages are exchanged between master and replica nodes for handshaking, heartbeats, log replication, elections, and group management.
Variants§
Handshake
Initial handshake from a node joining the replication stream.
HandshakeResponse
Response to a handshake.
Heartbeat
Heartbeat from master to replica.
HeartbeatResponse
Heartbeat response from replica to master.
LogEntry
A log entry being replicated from master to replica.
Ack
Acknowledgment of a replicated log entry.
GroupChange
A group membership change request.
GroupChangeResponse
Response to a group change request.
ElectionProposal
An election proposal from a candidate.
Fields
ElectionVote
A vote in response to an election proposal.
ElectionResult
The result of an election.
Shutdown
Graceful shutdown notification.
Implementations§
Trait Implementations§
Source§impl Clone for ProtocolMessage
impl Clone for ProtocolMessage
Source§fn clone(&self) -> ProtocolMessage
fn clone(&self) -> ProtocolMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProtocolMessage
impl Debug for ProtocolMessage
Source§impl PartialEq for ProtocolMessage
impl PartialEq for ProtocolMessage
Source§fn eq(&self, other: &ProtocolMessage) -> bool
fn eq(&self, other: &ProtocolMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProtocolMessage
Auto Trait Implementations§
impl Freeze for ProtocolMessage
impl RefUnwindSafe for ProtocolMessage
impl Send for ProtocolMessage
impl Sync for ProtocolMessage
impl Unpin for ProtocolMessage
impl UnsafeUnpin for ProtocolMessage
impl UnwindSafe for ProtocolMessage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more