mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 00:31:35 +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
@ -216,14 +216,14 @@ pub use self::simple::SimpleProtocol;
|
||||
pub use self::transport_ext::TransportExt;
|
||||
|
||||
use futures::prelude::*;
|
||||
use std::{error, time::Duration};
|
||||
use std::{error, io, time::Duration};
|
||||
|
||||
/// Builds a `Transport` that supports the most commonly-used protocols that libp2p supports.
|
||||
///
|
||||
/// > **Note**: This `Transport` is not suitable for production usage, as its implementation
|
||||
/// > reserves the right to support additional protocols or remove deprecated protocols.
|
||||
pub fn build_development_transport(keypair: identity::Keypair)
|
||||
-> impl Transport<Output = (PeerId, impl core::muxing::StreamMuxer<OutboundSubstream = impl Send, Substream = impl Send> + Send + Sync), Error = impl error::Error + Send, Listener = impl Send, Dial = impl Send, ListenerUpgrade = impl Send> + Clone
|
||||
-> impl Transport<Output = (PeerId, impl core::muxing::StreamMuxer<OutboundSubstream = impl Send, Substream = impl Send, Error = impl Into<io::Error>> + Send + Sync), Error = impl error::Error + Send, Listener = impl Send, Dial = impl Send, ListenerUpgrade = impl Send> + Clone
|
||||
{
|
||||
build_tcp_ws_secio_mplex_yamux(keypair)
|
||||
}
|
||||
@ -235,7 +235,7 @@ pub fn build_development_transport(keypair: identity::Keypair)
|
||||
///
|
||||
/// > **Note**: If you ever need to express the type of this `Transport`.
|
||||
pub fn build_tcp_ws_secio_mplex_yamux(keypair: identity::Keypair)
|
||||
-> impl Transport<Output = (PeerId, impl core::muxing::StreamMuxer<OutboundSubstream = impl Send, Substream = impl Send> + Send + Sync), Error = impl error::Error + Send, Listener = impl Send, Dial = impl Send, ListenerUpgrade = impl Send> + Clone
|
||||
-> impl Transport<Output = (PeerId, impl core::muxing::StreamMuxer<OutboundSubstream = impl Send, Substream = impl Send, Error = impl Into<io::Error>> + Send + Sync), Error = impl error::Error + Send, Listener = impl Send, Dial = impl Send, ListenerUpgrade = impl Send> + Clone
|
||||
{
|
||||
CommonTransport::new()
|
||||
.with_upgrade(secio::SecioConfig::new(keypair))
|
||||
|
Reference in New Issue
Block a user