pub struct Consensus {
pub votes: Vec<Option<usize>>,
pub modal_step: Option<usize>,
pub support: usize,
}Expand description
What N references agree on about one suspect run.
Two absences are distinct and both are honest: references == 0 (nothing was asked) and
every reference converging (asked, and the suspect looks normal to all of them) both leave
Consensus::modal_step as None. Consensus::references tells them apart.
Fields§
§votes: Vec<Option<usize>>One entry per reference, in input order: the suspect-side step that reference
localized the fork to (amberfork_model::DiffResult::fork_step_observed), or None
where that reference converged with the suspect.
Kept per-reference rather than pre-summed so a caller can see the shape of the disagreement — a 6/4 split at adjacent steps and a 6/4 split at opposite ends of the run are very different situations that one modal number hides.
modal_step: Option<usize>The step the plurality of forking references named, or None when none forked.
support: usizeHow many references voted for Consensus::modal_step. 0 exactly when it is None.
Implementations§
Source§impl Consensus
impl Consensus
Sourcepub fn references(&self) -> usize
pub fn references(&self) -> usize
How many references were consulted.
Trait Implementations§
impl Eq for Consensus
impl StructuralPartialEq for Consensus
Auto Trait Implementations§
impl Freeze for Consensus
impl RefUnwindSafe for Consensus
impl Send for Consensus
impl Sync for Consensus
impl Unpin for Consensus
impl UnsafeUnpin for Consensus
impl UnwindSafe for Consensus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.