pub struct ProtocolMessage {
pub id: Uuid,
pub from: NodeId,
pub to: Option<NodeId>,
pub timestamp: u64,
pub message_type: MessageType,
}Fields§
§id: Uuid§from: NodeId§to: Option<NodeId>§timestamp: u64§message_type: MessageTypeImplementations§
Source§impl ProtocolMessage
impl ProtocolMessage
pub fn new(from: NodeId, to: Option<NodeId>, message_type: MessageType) -> Self
pub fn propose(from: NodeId, proposal: ProposeMessage) -> Self
pub fn vote_round1(from: NodeId, to: NodeId, vote: VoteRound1Message) -> Self
pub fn vote_round2(from: NodeId, to: NodeId, vote: VoteRound2Message) -> Self
pub fn decision(from: NodeId, decision: DecisionMessage) -> Self
pub fn sync_request( from: NodeId, to: NodeId, request: SyncRequestMessage, ) -> Self
pub fn sync_response( from: NodeId, to: NodeId, response: SyncResponseMessage, ) -> Self
pub fn new_batch(from: NodeId, batch: NewBatchMessage) -> Self
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 · 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<'de> Deserialize<'de> for ProtocolMessage
impl<'de> Deserialize<'de> for ProtocolMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ProtocolMessage
impl Serialize 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