mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-31 00:41:59 +00:00
Swarm rework (#182)
* Rename Transport::RawConn to Output * Remove AsyncRead + AsyncWrite bound on Transport::Output * UpgradedNode now always implements Transport * Add and tweak modifiers for Transport and ConnectionUpgrade * Secio upgrade now returns the pubkey in its output * Add upgrade::apply * Add Transport::and_then * Rework the swarm * Rustfmt * Fix concerns
This commit is contained in:
@@ -99,10 +99,10 @@ impl<T> Transport for DnsConfig<T>
|
||||
where
|
||||
T: Transport + 'static, // TODO: 'static :-/
|
||||
{
|
||||
type RawConn = T::RawConn;
|
||||
type Output = T::Output;
|
||||
type Listener = T::Listener;
|
||||
type ListenerUpgrade = T::ListenerUpgrade;
|
||||
type Dial = Box<Future<Item = (Self::RawConn, Multiaddr), Error = IoError>>;
|
||||
type Dial = Box<Future<Item = (Self::Output, Multiaddr), Error = IoError>>;
|
||||
|
||||
#[inline]
|
||||
fn listen_on(self, addr: Multiaddr) -> Result<(Self::Listener, Multiaddr), (Self, Multiaddr)> {
|
||||
@@ -238,10 +238,10 @@ mod tests {
|
||||
#[derive(Clone)]
|
||||
struct CustomTransport;
|
||||
impl Transport for CustomTransport {
|
||||
type RawConn = <TcpConfig as Transport>::RawConn;
|
||||
type Output = <TcpConfig as Transport>::Output;
|
||||
type Listener = <TcpConfig as Transport>::Listener;
|
||||
type ListenerUpgrade = <TcpConfig as Transport>::ListenerUpgrade;
|
||||
type Dial = Box<Future<Item = (Self::RawConn, Multiaddr), Error = IoError>>;
|
||||
type Dial = Box<Future<Item = (Self::Output, Multiaddr), Error = IoError>>;
|
||||
|
||||
#[inline]
|
||||
fn listen_on(
|
||||
|
Reference in New Issue
Block a user