mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-02 19:21:37 +00:00
muxing: adds an error type to streammuxer (#1083)
* muxing: adds an error type to streammuxer * Update examples/chat.rs Co-Authored-By: montekki <fedor.sakharov@gmail.com> * make the trait error type bound to io error
This commit is contained in:
committed by
Pierre Krieger
parent
47a775dbce
commit
68df8c07cf
@ -150,7 +150,7 @@ where TMuxer: muxing::StreamMuxer + Send + Sync + 'static,
|
||||
self.state = IdRetrieverState::OpeningSubstream(muxer, opening, config);
|
||||
return Ok(Async::NotReady);
|
||||
},
|
||||
Err(err) => return Err(UpgradeError::Apply(err))
|
||||
Err(err) => return Err(UpgradeError::Apply(err.into()))
|
||||
}
|
||||
},
|
||||
IdRetrieverState::NegotiatingIdentify(muxer, mut nego) => {
|
||||
|
@ -238,7 +238,7 @@ mod tests {
|
||||
use tokio::runtime::current_thread;
|
||||
|
||||
fn transport() -> (identity::PublicKey, impl Transport<
|
||||
Output = (PeerId, impl StreamMuxer<Substream = impl Send, OutboundSubstream = impl Send>),
|
||||
Output = (PeerId, impl StreamMuxer<Substream = impl Send, OutboundSubstream = impl Send, Error = impl Into<io::Error>>),
|
||||
Listener = impl Send,
|
||||
ListenerUpgrade = impl Send,
|
||||
Dial = impl Send,
|
||||
|
@ -34,7 +34,7 @@ use libp2p_yamux as yamux;
|
||||
use libp2p_secio::SecioConfig;
|
||||
use libp2p_tcp::TcpConfig;
|
||||
use futures::{future, prelude::*};
|
||||
use std::{fmt, time::Duration, sync::mpsc::sync_channel};
|
||||
use std::{fmt, io, time::Duration, sync::mpsc::sync_channel};
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
#[test]
|
||||
@ -102,7 +102,7 @@ fn ping() {
|
||||
}
|
||||
|
||||
fn mk_transport() -> (PeerId, impl Transport<
|
||||
Output = (PeerId, impl StreamMuxer<Substream = impl Send, OutboundSubstream = impl Send>),
|
||||
Output = (PeerId, impl StreamMuxer<Substream = impl Send, OutboundSubstream = impl Send, Error = impl Into<io::Error>>),
|
||||
Listener = impl Send,
|
||||
ListenerUpgrade = impl Send,
|
||||
Dial = impl Send,
|
||||
|
Reference in New Issue
Block a user