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;
@@ -266,8 +266,8 @@ pub use self::transport_ext::TransportExt;
266
266
///
267
267
/// > **Note**: This `Transport` is not suitable for production usage, as its implementation
268
268
/// > reserves the right to support additional protocols or remove deprecated protocols.
269
- #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ]
270
- #[ cfg_attr( docsrs, doc( cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ) ) ]
269
+ #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp-async-std " , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ]
270
+ #[ 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" ) ) ) ) ]
271
271
pub fn build_development_transport ( keypair : identity:: Keypair )
272
272
-> std:: io:: Result < impl Transport < Output = ( PeerId , impl core:: muxing:: StreamMuxer < OutboundSubstream = impl Send , Substream = impl Send , Error = impl Into < std:: io:: Error > > + Send + Sync ) , Error = impl std:: error:: Error + Send , Listener = impl Send , Dial = impl Send , ListenerUpgrade = impl Send > + Clone >
273
273
{
@@ -280,8 +280,8 @@ pub fn build_development_transport(keypair: identity::Keypair)
280
280
/// and mplex or yamux as the multiplexing layer.
281
281
///
282
282
/// > **Note**: If you ever need to express the type of this `Transport`.
283
- #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ]
284
- #[ cfg_attr( docsrs, doc( cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ) ) ]
283
+ #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp-async-std " , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" ) ) ]
284
+ #[ 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" ) ) ) ) ]
285
285
pub fn build_tcp_ws_secio_mplex_yamux ( keypair : identity:: Keypair )
286
286
-> std:: io:: Result < impl Transport < Output = ( PeerId , impl core:: muxing:: StreamMuxer < OutboundSubstream = impl Send , Substream = impl Send , Error = impl Into < std:: io:: Error > > + Send + Sync ) , Error = impl std:: error:: Error + Send , Listener = impl Send , Dial = impl Send , ListenerUpgrade = impl Send > + Clone >
287
287
{
@@ -306,8 +306,8 @@ pub fn build_tcp_ws_secio_mplex_yamux(keypair: identity::Keypair)
306
306
/// and mplex or yamux as the multiplexing layer.
307
307
///
308
308
/// > **Note**: If you ever need to express the type of this `Transport`.
309
- #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp" , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" , feature = "pnet" ) ) ]
310
- #[ 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" ) ) ) ) ]
309
+ #[ cfg( all( not( any( target_os = "emscripten" , target_os = "unknown" ) ) , feature = "tcp-async-std " , feature = "websocket" , feature = "secio" , feature = "mplex" , feature = "yamux" , feature = "pnet" ) ) ]
310
+ #[ 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" ) ) ) ) ]
311
311
pub fn build_tcp_ws_pnet_secio_mplex_yamux ( keypair : identity:: Keypair , psk : PreSharedKey )
312
312
-> std:: io:: Result < impl Transport < Output = ( PeerId , impl core:: muxing:: StreamMuxer < OutboundSubstream = impl Send , Substream = impl Send , Error = impl Into < std:: io:: Error > > + Send + Sync ) , Error = impl std:: error:: Error + Send , Listener = impl Send , Dial = impl Send , ListenerUpgrade = impl Send > + Clone >
313
313
{
0 commit comments