85
85
//! Example ([`secio`] + [`yamux`] Protocol Upgrade):
86
86
//!
87
87
//! ```rust
88
- //! # #[cfg(all(not(any(target_os = "emscripten", target_os = "unknown")), feature = "tcp", feature = "secio", feature = "yamux"))] {
88
+ //! # #[cfg(all(not(any(target_os = "emscripten", target_os = "unknown")), feature = "tcp-async-std ", feature = "secio", feature = "yamux"))] {
89
89
//! use libp2p::{Transport, core::upgrade, tcp::TcpConfig, secio::SecioConfig, identity::Keypair, yamux};
90
90
//! let tcp = TcpConfig::new();
91
91
//! let secio = SecioConfig::new(Keypair::generate_ed25519());
@@ -217,8 +217,8 @@ pub use libp2p_plaintext as plaintext;
217
217
pub use libp2p_secio as secio;
218
218
#[ doc( inline) ]
219
219
pub use libp2p_swarm as swarm;
220
- #[ cfg( feature = "tcp" ) ]
221
- #[ cfg_attr( docsrs, doc( cfg( feature = "tcp" ) ) ) ]
220
+ #[ cfg( any ( feature = "tcp-async-std" , feature = "tcp-tokio-std" ) ) ]
221
+ #[ cfg_attr( docsrs, doc( cfg( any ( feature = "tcp-async-std" , feature = "tcp-tokio-std" ) ) ) ) ]
222
222
#[ cfg( not( any( target_os = "emscripten" , target_os = "unknown" ) ) ) ]
223
223
#[ doc( inline) ]
224
224
pub use libp2p_tcp as tcp;
@@ -268,8 +268,8 @@ use std::{error, io, time::Duration};
268
268
///
269
269
/// > **Note**: This `Transport` is not suitable for production usage, as its implementation
270
270
/// > reserves the right to support additional protocols or remove deprecated protocols.
271
- #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ]
272
- #[ cfg_attr( docsrs, doc( cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ) ) ]
271
+ #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp-async-std " , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ]
272
+ #[ cfg_attr( docsrs, doc( cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp-async-std " , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ) ) ]
273
273
pub fn build_development_transport ( keypair : identity:: Keypair )
274
274
-> io:: Result < 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 >
275
275
{
@@ -282,8 +282,8 @@ pub fn build_development_transport(keypair: identity::Keypair)
282
282
/// and mplex or yamux as the multiplexing layer.
283
283
///
284
284
/// > **Note**: If you ever need to express the type of this `Transport`.
285
- #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ]
286
- #[ cfg_attr( docsrs, doc( cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ) ) ]
285
+ #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp-async-std " , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ]
286
+ #[ cfg_attr( docsrs, doc( cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp-async-std " , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ) ) ]
287
287
pub fn build_tcp_ws_secio_mplex_yamux ( keypair : identity:: Keypair )
288
288
-> io:: Result < 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 >
289
289
{
@@ -308,8 +308,8 @@ pub fn build_tcp_ws_secio_mplex_yamux(keypair: identity::Keypair)
308
308
/// and mplex or yamux as the multiplexing layer.
309
309
///
310
310
/// > **Note**: If you ever need to express the type of this `Transport`.
311
- #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" , feature = "pnet" ) ) ]
312
- #[ cfg_attr( docsrs, doc( cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" , feature = "pnet" ) ) ) ) ]
311
+ #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp-async-std " , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" , feature = "pnet" ) ) ]
312
+ #[ cfg_attr( docsrs, doc( cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp-async-std " , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" , feature = "pnet" ) ) ) ) ]
313
313
pub fn build_tcp_ws_pnet_secio_mplex_yamux ( keypair : identity:: Keypair , psk : PreSharedKey )
314
314
-> io:: Result < 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 >
315
315
{
0 commit comments