pub struct ByWeight<F: Fn(&Message) -> u64 + Send + Sync> {
pub weight: F,
pub threshold: u64,
}Expand description
Weighted-quorum completion: sum of weight(msg) over the group must reach threshold.
The canonical use case is voting-power quorums where each message carries its weight in a
header — e.g. weight = |m| m.header("voting_power")?.parse().ok().
Fields§
§weight: F§threshold: u64Trait Implementations§
Source§impl<F> CompletionCondition for ByWeight<F>
impl<F> CompletionCondition for ByWeight<F>
Auto Trait Implementations§
impl<F> Freeze for ByWeight<F>where
F: Freeze,
impl<F> RefUnwindSafe for ByWeight<F>where
F: RefUnwindSafe,
impl<F> Send for ByWeight<F>
impl<F> Sync for ByWeight<F>
impl<F> Unpin for ByWeight<F>where
F: Unpin,
impl<F> UnsafeUnpin for ByWeight<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for ByWeight<F>where
F: UnwindSafe,
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