Struct kitsune_p2p_dht_arc::PeerViewAlpha
source · [−]pub struct PeerViewAlpha { /* private fields */ }
Expand description
The default, and only, PeerView.
Implementations
sourceimpl PeerViewAlpha
impl PeerViewAlpha
sourcepub fn new(
strat: PeerStratAlpha,
filter: DhtArc,
average_coverage: f64,
count: usize
) -> Self
pub fn new(
strat: PeerStratAlpha,
filter: DhtArc,
average_coverage: f64,
count: usize
) -> Self
Create a new peer view reading from the:
- The filter used to create the bucket.
- Average coverage of all peers in the bucket.
- Count of peers in the bucket.
sourcepub fn next_coverage(&self, current: f64) -> f64
pub fn next_coverage(&self, current: f64) -> f64
Given the current coverage, what is the next step to take in reaching the ideal coverage?
sourcepub fn expected_count(&self) -> usize
pub fn expected_count(&self) -> usize
The expected number of peers for this arc over time.
sourcepub fn est_gap(&self) -> f64
pub fn est_gap(&self) -> f64
Estimate the gap in coverage that needs to be filled. If the gap is negative that means we are over covered.
sourcepub fn est_total_peers(&self) -> usize
pub fn est_total_peers(&self) -> usize
Estimate total peers.
sourcepub fn est_total_redundancy(&self) -> usize
pub fn est_total_redundancy(&self) -> usize
Estimated total redundant coverage.
Trait Implementations
sourceimpl Clone for PeerViewAlpha
impl Clone for PeerViewAlpha
sourcefn clone(&self) -> PeerViewAlpha
fn clone(&self) -> PeerViewAlpha
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PeerViewAlpha
impl Debug for PeerViewAlpha
sourceimpl From<PeerViewAlpha> for PeerView
impl From<PeerViewAlpha> for PeerView
sourcefn from(original: PeerViewAlpha) -> PeerView
fn from(original: PeerViewAlpha) -> PeerView
Converts to this type from the input type.
impl Copy for PeerViewAlpha
Auto Trait Implementations
impl RefUnwindSafe for PeerViewAlpha
impl Send for PeerViewAlpha
impl Sync for PeerViewAlpha
impl Unpin for PeerViewAlpha
impl UnwindSafe for PeerViewAlpha
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more