pub struct Round {
pub num: u64,
/* private fields */
}Fields§
§num: u64Implementations§
Source§impl Round
impl Round
pub fn new(num: u64, role: Role, threshold: u64) -> Self
pub fn stage(&self) -> Stage
pub fn role(&self) -> Role
pub fn block(&self) -> Option<&Block>
pub fn set_block(&mut self, block: Block)
Sourcepub fn add_prepare_vote(&mut self, voter: NodeId) -> bool
pub fn add_prepare_vote(&mut self, voter: NodeId) -> bool
Record a prepare vote. Returns false if this voter already voted.
Sourcepub fn add_commit_vote(&mut self, voter: NodeId) -> bool
pub fn add_commit_vote(&mut self, voter: NodeId) -> bool
Record a commit vote. Returns false if this voter already voted.
pub fn prepare_count(&self) -> u64
pub fn commit_count(&self) -> u64
pub fn has_prepare_quorum(&self) -> bool
pub fn has_commit_quorum(&self) -> bool
pub fn advance(&mut self, to: Stage) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Round
impl RefUnwindSafe for Round
impl Send for Round
impl Sync for Round
impl Unpin for Round
impl UnsafeUnpin for Round
impl UnwindSafe for Round
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