pub struct PhaseData {
pub phase_id: PhaseId,
pub batch_id: Option<BatchId>,
pub proposed_value: Option<StateValue>,
pub round1_votes: HashMap<NodeId, StateValue>,
pub round2_votes: HashMap<NodeId, StateValue>,
pub decision: Option<StateValue>,
pub batch: Option<CommandBatch>,
pub timestamp: u64,
pub is_committed: bool,
}
Fields§
§phase_id: PhaseId
§batch_id: Option<BatchId>
§proposed_value: Option<StateValue>
§round1_votes: HashMap<NodeId, StateValue>
§round2_votes: HashMap<NodeId, StateValue>
§decision: Option<StateValue>
§batch: Option<CommandBatch>
§timestamp: u64
§is_committed: bool
Implementations§
Source§impl PhaseData
impl PhaseData
pub fn new(phase_id: PhaseId) -> Self
pub fn add_round1_vote(&mut self, voter: NodeId, vote: StateValue)
pub fn add_round2_vote(&mut self, voter: NodeId, vote: StateValue)
pub fn has_round1_majority(&self, quorum_size: usize) -> Option<StateValue>
pub fn has_round2_majority(&self, quorum_size: usize) -> Option<StateValue>
pub fn total_votes(&self) -> usize
pub fn set_decision(&mut self, decision: StateValue)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PhaseData
impl<'de> Deserialize<'de> for PhaseData
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
Auto Trait Implementations§
impl Freeze for PhaseData
impl RefUnwindSafe for PhaseData
impl Send for PhaseData
impl Sync for PhaseData
impl Unpin for PhaseData
impl UnwindSafe for PhaseData
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