pub struct VoteTally {
pub accept: u64,
pub reject: u64,
pub abstain: u64,
pub suggest: u64,
}Expand description
Vote tallying result for counting signature votes
Fields§
§accept: u64Number of accept votes
reject: u64Number of reject votes
abstain: u64Number of abstain votes
suggest: u64Number of suggest votes
Implementations§
Source§impl VoteTally
impl VoteTally
Sourcepub fn total_active(&self) -> u64
pub fn total_active(&self) -> u64
Get the total number of votes (excluding abstentions)
Sourcepub fn passes_simple_majority(&self) -> bool
pub fn passes_simple_majority(&self) -> bool
Check if the vote passes with simple majority (more accepts than rejects)
Sourcepub fn passes_strict_majority(&self) -> bool
pub fn passes_strict_majority(&self) -> bool
Check if the vote passes with strict majority (>50% accepts of active votes)
Sourcepub fn passes_supermajority(&self) -> bool
pub fn passes_supermajority(&self) -> bool
Check if the vote passes with supermajority (>=2/3 accepts of active votes)
Sourcepub fn passes_threshold(&self, threshold_percent: u64) -> bool
pub fn passes_threshold(&self, threshold_percent: u64) -> bool
Check if the vote passes with given threshold (accepts as percentage of active votes)
Sourcepub fn acceptance_percentage(&self) -> f64
pub fn acceptance_percentage(&self) -> f64
Get the acceptance percentage (of active votes)
Trait Implementations§
impl Eq for VoteTally
impl StructuralPartialEq for VoteTally
Auto Trait Implementations§
impl Freeze for VoteTally
impl RefUnwindSafe for VoteTally
impl Send for VoteTally
impl Sync for VoteTally
impl Unpin for VoteTally
impl UnsafeUnpin for VoteTally
impl UnwindSafe for VoteTally
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