pub struct ReconCycle {
pub peers_attempted: u64,
pub peers_exchanged: u64,
pub ranges_diverged: u64,
pub ranges_repaired: u64,
}Expand description
Outcome of a single reconciliation pass.
All four counters are simple totals over the peers visited
during one cycle of EntropyDriver::run_cycle.
§Examples
use dynomite::entropy::driver::ReconCycle;
let mut c = ReconCycle::default();
c.record_attempted();
c.record_exchanged(128);
assert_eq!(c.peers_attempted, 1);
assert_eq!(c.peers_exchanged, 1);
assert_eq!(c.ranges_diverged, 1);
assert_eq!(c.ranges_repaired, 1);Fields§
§peers_attempted: u64Peers the driver attempted to dial during the cycle.
peers_exchanged: u64Peers the driver successfully exchanged a snapshot with.
ranges_diverged: u64Number of divergent ranges observed (one per peer when the snapshot was non-empty).
ranges_repaired: u64Number of divergent ranges actually repaired (currently
equals Self::ranges_diverged: every range pushed is
considered repaired once the receiver acknowledges by
closing the socket).
Implementations§
Source§impl ReconCycle
impl ReconCycle
Sourcepub fn record_attempted(&mut self)
pub fn record_attempted(&mut self)
Note that the driver dialled one more peer.
Sourcepub fn record_exchanged(&mut self, bytes: usize)
pub fn record_exchanged(&mut self, bytes: usize)
Note that one peer interaction completed successfully.
bytes is the plaintext snapshot length the sender
pushed; non-zero values are interpreted as one divergent
range repaired.
Sourcepub fn merge(&mut self, other: ReconCycle)
pub fn merge(&mut self, other: ReconCycle)
Merge other into self.
Trait Implementations§
Source§impl Clone for ReconCycle
impl Clone for ReconCycle
Source§fn clone(&self) -> ReconCycle
fn clone(&self) -> ReconCycle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReconCycle
impl Debug for ReconCycle
Source§impl Default for ReconCycle
impl Default for ReconCycle
Source§fn default() -> ReconCycle
fn default() -> ReconCycle
Source§impl PartialEq for ReconCycle
impl PartialEq for ReconCycle
Source§fn eq(&self, other: &ReconCycle) -> bool
fn eq(&self, other: &ReconCycle) -> bool
self and other values to be equal, and is used by ==.impl Copy for ReconCycle
impl Eq for ReconCycle
impl StructuralPartialEq for ReconCycle
Auto Trait Implementations§
impl Freeze for ReconCycle
impl RefUnwindSafe for ReconCycle
impl Send for ReconCycle
impl Sync for ReconCycle
impl Unpin for ReconCycle
impl UnsafeUnpin for ReconCycle
impl UnwindSafe for ReconCycle
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§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.