Struct kitsune_p2p_dht_arc::PeerDensity
source · [−]pub struct PeerDensity { /* private fields */ }
Expand description
The average density of peers at a location in the u32 space.
Implementations
sourceimpl PeerDensity
impl PeerDensity
sourcepub fn new(filter: DhtArc, average_coverage: f64, count: usize) -> Self
pub fn new(filter: DhtArc, average_coverage: f64, count: usize) -> Self
Create a new peer density 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 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 PeerDensity
impl Clone for PeerDensity
sourcefn clone(&self) -> PeerDensity
fn clone(&self) -> PeerDensity
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 PeerDensity
impl Debug for PeerDensity
impl Copy for PeerDensity
Auto Trait Implementations
impl RefUnwindSafe for PeerDensity
impl Send for PeerDensity
impl Sync for PeerDensity
impl Unpin for PeerDensity
impl UnwindSafe for PeerDensity
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub 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