pub struct KBucket {
pub k: usize,
pub peers: VecDeque<BucketEntry>,
pub last_updated: Instant,
}Expand description
K-bucket containing peers at a specific distance range
Fields§
§k: usizeMaximum bucket size (k parameter)
peers: VecDeque<BucketEntry>Peers in this bucket (oldest first)
last_updated: InstantLast update time
Implementations§
Source§impl KBucket
impl KBucket
Sourcepub fn remove_peer(&mut self, peer_id: &PeerId) -> bool
pub fn remove_peer(&mut self, peer_id: &PeerId) -> bool
Remove peer from bucket
Sourcepub fn mark_failed(&mut self, peer_id: &PeerId)
pub fn mark_failed(&mut self, peer_id: &PeerId)
Mark peer as failed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KBucket
impl RefUnwindSafe for KBucket
impl Send for KBucket
impl Sync for KBucket
impl Unpin for KBucket
impl UnsafeUnpin for KBucket
impl UnwindSafe for KBucket
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
Mutably borrows from an owned value. Read more