mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-23 23:01:33 +00:00
New core (#568)
* New core * Fix lifetime requirements * Remove identify transport * Address &mut & ref ref mut * Fix whitespaces
This commit is contained in:
@ -58,7 +58,7 @@
|
||||
//!
|
||||
//! let future = transport.dial("/ip4/127.0.0.1/tcp/12345".parse::<Multiaddr>().unwrap())
|
||||
//! .unwrap_or_else(|_| panic!("Unable to dial node"))
|
||||
//! .and_then(|(connection, _)| {
|
||||
//! .and_then(|connection| {
|
||||
//! // Sends "hello world" on the connection, will be encrypted.
|
||||
//! write_all(connection, "hello world")
|
||||
//! });
|
||||
@ -349,14 +349,12 @@ where
|
||||
pub ephemeral_public_key: Vec<u8>,
|
||||
}
|
||||
|
||||
impl<S, Maf> libp2p_core::ConnectionUpgrade<S, Maf> for SecioConfig
|
||||
impl<S> libp2p_core::ConnectionUpgrade<S> for SecioConfig
|
||||
where
|
||||
S: AsyncRead + AsyncWrite + Send + 'static, // TODO: 'static :(
|
||||
Maf: Send + 'static, // TODO: 'static :(
|
||||
{
|
||||
type Output = SecioOutput<S>;
|
||||
type MultiaddrFuture = Maf;
|
||||
type Future = Box<Future<Item = (Self::Output, Maf), Error = IoError> + Send>;
|
||||
type Future = Box<Future<Item = Self::Output, Error = IoError> + Send>;
|
||||
type NamesIter = iter::Once<(Bytes, ())>;
|
||||
type UpgradeIdentifier = ();
|
||||
|
||||
@ -371,7 +369,6 @@ where
|
||||
incoming: S,
|
||||
_: (),
|
||||
_: libp2p_core::Endpoint,
|
||||
remote_addr: Maf,
|
||||
) -> Self::Future {
|
||||
debug!("Starting secio upgrade");
|
||||
|
||||
@ -384,7 +381,7 @@ where
|
||||
ephemeral_public_key: ephemeral,
|
||||
}
|
||||
}).map_err(map_err);
|
||||
Box::new(wrapped.map(move |out| (out, remote_addr)))
|
||||
Box::new(wrapped)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user