Struct kitsune_p2p_dht_arc::DhtArcBucket
source · [−]pub struct DhtArcBucket { /* private fields */ }
Expand description
When sampling a section of the arc we can
collect all the other peer DhtArc
s into a
DhtBucket.
All the peer arcs arc contained within the buckets filter arc.
The filter is this peer’s “view” into their section of the dht arc.
Implementations
sourceimpl DhtArcBucket
impl DhtArcBucket
sourcepub fn new<I: IntoIterator<Item = DhtArc>>(filter: DhtArc, arcs: I) -> Self
pub fn new<I: IntoIterator<Item = DhtArc>>(filter: DhtArc, arcs: I) -> Self
Select only the arcs that fit into the bucket.
sourcepub fn new_unchecked(bucket: DhtArc, arcs: Vec<DhtArc>) -> Self
pub fn new_unchecked(bucket: DhtArc, arcs: Vec<DhtArc>) -> Self
Same as new but doesn’t check if arcs fit into the bucket.
sourcepub fn density(&self) -> PeerDensity
pub fn density(&self) -> PeerDensity
Get the density of this bucket.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DhtArcBucket
impl Send for DhtArcBucket
impl Sync for DhtArcBucket
impl Unpin for DhtArcBucket
impl UnwindSafe for DhtArcBucket
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