Add a KademliaHandler (#580)

* Rework Kademlia for the new design

* Minor work on protocol.rs

* More work

* Remove QueryTarget::FindValue

* Finish work on query

* Query timeout test

* Work on topology

* More work

* Update protocols/kad/src/topology.rs

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>

* Fix trailing whitespaces

* Use if let
This commit is contained in:
Pierre Krieger
2018-11-29 12:11:35 +01:00
committed by GitHub
parent ab192cdca7
commit 3aa1fcbdc6
21 changed files with 2357 additions and 1666 deletions

View File

@ -48,7 +48,7 @@ impl<TSubstream> Default for PeriodicPingBehaviour<TSubstream> {
}
}
impl<TSubstream> NetworkBehaviour for PeriodicPingBehaviour<TSubstream>
impl<TSubstream, TTopology> NetworkBehaviour<TTopology> for PeriodicPingBehaviour<TSubstream>
where
TSubstream: AsyncRead + AsyncWrite,
{
@ -72,6 +72,7 @@ where
fn poll(
&mut self,
_: &mut TTopology,
) -> Async<
NetworkBehaviourAction<
<Self::ProtocolsHandler as ProtocolsHandler>::InEvent,

View File

@ -48,7 +48,7 @@ impl<TSubstream> Default for PingListenBehaviour<TSubstream> {
}
}
impl<TSubstream> NetworkBehaviour for PingListenBehaviour<TSubstream>
impl<TSubstream, TTopology> NetworkBehaviour<TTopology> for PingListenBehaviour<TSubstream>
where
TSubstream: AsyncRead + AsyncWrite,
{
@ -72,6 +72,7 @@ where
fn poll(
&mut self,
_: &mut TTopology,
) -> Async<
NetworkBehaviourAction<
<Self::ProtocolsHandler as ProtocolsHandler>::InEvent,