pub struct RoutingTable { /* private fields */ }Expand description
Kademlia routing table
Implementations§
Source§impl RoutingTable
impl RoutingTable
Sourcepub fn remove_peer(&mut self, peer_id: &PeerId) -> Result<bool>
pub fn remove_peer(&mut self, peer_id: &PeerId) -> Result<bool>
Remove peer from routing table
Sourcepub fn find_closest(&self, target: &PeerId, count: usize) -> Vec<PeerInfo>
pub fn find_closest(&self, target: &PeerId, count: usize) -> Vec<PeerInfo>
Find closest K peers to target ID
Sourcepub fn peer_count(&self) -> usize
pub fn peer_count(&self) -> usize
Get total number of peers
Sourcepub fn mark_failed(&mut self, peer_id: &PeerId) -> Result<()>
pub fn mark_failed(&mut self, peer_id: &PeerId) -> Result<()>
Mark peer as failed
Auto Trait Implementations§
impl Freeze for RoutingTable
impl RefUnwindSafe for RoutingTable
impl Send for RoutingTable
impl Sync for RoutingTable
impl Unpin for RoutingTable
impl UnsafeUnpin for RoutingTable
impl UnwindSafe for RoutingTable
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