mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-25 15:51:34 +00:00
Implement Send everywhere (#458)
This commit is contained in:
@ -59,9 +59,9 @@ use {SecioKeyPair, SecioKeyPairInner};
|
||||
pub fn handshake<'a, S: 'a>(
|
||||
socket: S,
|
||||
local_key: SecioKeyPair,
|
||||
) -> Box<Future<Item = (FullCodec<S>, PublicKey, Vec<u8>), Error = SecioError> + 'a>
|
||||
) -> Box<Future<Item = (FullCodec<S>, PublicKey, Vec<u8>), Error = SecioError> + Send + 'a>
|
||||
where
|
||||
S: AsyncRead + AsyncWrite,
|
||||
S: AsyncRead + AsyncWrite + Send,
|
||||
{
|
||||
// TODO: could be rewritten as a coroutine once coroutines land in stable Rust
|
||||
|
||||
|
@ -289,12 +289,12 @@ where
|
||||
|
||||
impl<S, Maf> libp2p_core::ConnectionUpgrade<S, Maf> for SecioConfig
|
||||
where
|
||||
S: AsyncRead + AsyncWrite + 'static, // TODO: 'static :(
|
||||
Maf: 'static, // TODO: 'static :(
|
||||
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>>;
|
||||
type Future = Box<Future<Item = (Self::Output, Maf), Error = IoError> + Send>;
|
||||
type NamesIter = iter::Once<(Bytes, ())>;
|
||||
type UpgradeIdentifier = ();
|
||||
|
||||
@ -342,7 +342,7 @@ pub struct SecioMiddleware<S> {
|
||||
|
||||
impl<S> SecioMiddleware<S>
|
||||
where
|
||||
S: AsyncRead + AsyncWrite,
|
||||
S: AsyncRead + AsyncWrite + Send,
|
||||
{
|
||||
/// Attempts to perform a handshake on the given socket.
|
||||
///
|
||||
@ -351,7 +351,7 @@ where
|
||||
pub fn handshake<'a>(
|
||||
socket: S,
|
||||
key_pair: SecioKeyPair,
|
||||
) -> Box<Future<Item = (SecioMiddleware<S>, PublicKey, Vec<u8>), Error = SecioError> + 'a>
|
||||
) -> Box<Future<Item = (SecioMiddleware<S>, PublicKey, Vec<u8>), Error = SecioError> + Send + 'a>
|
||||
where
|
||||
S: 'a,
|
||||
{
|
||||
|
Reference in New Issue
Block a user