pub struct VoteCollector { /* private fields */ }Expand description
Vote collection for tracking quorum.
Implementations§
Source§impl VoteCollector
impl VoteCollector
Sourcepub fn add_notarize(&mut self, vote: NotarizeMessage)
pub fn add_notarize(&mut self, vote: NotarizeMessage)
Adds a notarize vote.
Sourcepub fn add_finalize(&mut self, vote: FinalizeMessage)
pub fn add_finalize(&mut self, vote: FinalizeMessage)
Adds a finalize vote.
Sourcepub fn add_nullify(&mut self, vote: NullifyMessage)
pub fn add_nullify(&mut self, vote: NullifyMessage)
Adds a nullify vote.
Sourcepub fn get_notarize_votes(&self, block_id: &BlockId) -> &[NotarizeMessage]
pub fn get_notarize_votes(&self, block_id: &BlockId) -> &[NotarizeMessage]
Gets notarize votes for a block.
Sourcepub fn get_finalize_votes(&self, block_id: &BlockId) -> &[FinalizeMessage]
pub fn get_finalize_votes(&self, block_id: &BlockId) -> &[FinalizeMessage]
Gets finalize votes for a block.
Sourcepub fn get_nullify_votes(&self, view: u64) -> &[NullifyMessage]
pub fn get_nullify_votes(&self, view: u64) -> &[NullifyMessage]
Gets nullify votes for a view.
Sourcepub fn notarize_count(&self, block_id: &BlockId) -> usize
pub fn notarize_count(&self, block_id: &BlockId) -> usize
Returns the number of notarize votes for a block.
Sourcepub fn finalize_count(&self, block_id: &BlockId) -> usize
pub fn finalize_count(&self, block_id: &BlockId) -> usize
Returns the number of finalize votes for a block.
Sourcepub fn nullify_count(&self, view: u64) -> usize
pub fn nullify_count(&self, view: u64) -> usize
Returns the number of nullify votes for a view.
Sourcepub fn clear_view(&mut self, view: u64)
pub fn clear_view(&mut self, view: u64)
Clears votes for a given view (after finalization or nullification).
Trait Implementations§
Source§impl Clone for VoteCollector
impl Clone for VoteCollector
Source§fn clone(&self) -> VoteCollector
fn clone(&self) -> VoteCollector
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 VoteCollector
impl Debug for VoteCollector
Source§impl Default for VoteCollector
impl Default for VoteCollector
Source§fn default() -> VoteCollector
fn default() -> VoteCollector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VoteCollector
impl RefUnwindSafe for VoteCollector
impl Send for VoteCollector
impl Sync for VoteCollector
impl Unpin for VoteCollector
impl UnwindSafe for VoteCollector
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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