pub struct QuorumThreshold {
pub threshold_type: String,
pub value: f64,
}Expand description
Threshold rules for Quorum mode (distinct from QuorumRules used in Decision mode’s voting.quorum).
Fields§
§threshold_type: String§value: f64Implementations§
Source§impl QuorumThreshold
impl QuorumThreshold
Sourcepub fn effective(&self, total_participants: usize) -> EffectiveThreshold
pub fn effective(&self, total_participants: usize) -> EffectiveThreshold
Resolve this threshold against a session with total_participants
declared participants. See EffectiveThreshold for the contract —
both the mode and the policy evaluator must resolve through here.
Rounding is ceiling (0.5 of a participant is a whole participant,
and half a vote cannot approve anything), and the result has a floor of
one approval. That floor is what makes T = 0 unreachable: at T = 0
a session is “ready to commit” with no ballot cast at all, and a
negative commitment then seals with zero approvals (issue #145).
Trait Implementations§
Source§impl Clone for QuorumThreshold
impl Clone for QuorumThreshold
Source§fn clone(&self) -> QuorumThreshold
fn clone(&self) -> QuorumThreshold
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 QuorumThreshold
impl Debug for QuorumThreshold
Source§impl Default for QuorumThreshold
impl Default for QuorumThreshold
Source§impl<'de> Deserialize<'de> for QuorumThreshold
impl<'de> Deserialize<'de> for QuorumThreshold
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 QuorumThreshold
impl RefUnwindSafe for QuorumThreshold
impl Send for QuorumThreshold
impl Sync for QuorumThreshold
impl Unpin for QuorumThreshold
impl UnsafeUnpin for QuorumThreshold
impl UnwindSafe for QuorumThreshold
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