Cargo.toml: Deprecate executor specific features for sub-crates (#2962)

This commit is contained in:
Thomas Eizinger
2022-10-11 23:10:10 +11:00
committed by GitHub
parent aba5ccbce3
commit 31a45f2d76
3 changed files with 122 additions and 22 deletions

View File

@ -54,14 +54,31 @@ pub use libp2p_dcutr as dcutr;
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[doc(inline)]
pub use libp2p_deflate as deflate;
#[cfg(any(feature = "dns-async-std", feature = "dns-tokio"))]
#[deprecated(
since = "0.49.0",
note = "The `dns-tokio` and `dns-async-std` features are deprecated. Use the new `dns` feature together with the `tokio` or `async-std` features."
)]
#[cfg(all(
any(feature = "dns-tokio", feature = "dns-async-std"),
not(feature = "dns")
))]
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[cfg_attr(
docsrs,
doc(cfg(any(feature = "dns-async-std", feature = "dns-tokio")))
doc(cfg(any(feature = "dns-tokio", feature = "dns-async-std")))
)]
pub mod dns {
#[doc(inline)]
pub use libp2p_dns::*;
}
#[cfg(feature = "dns")]
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[doc(inline)]
pub use libp2p_dns as dns;
#[cfg_attr(docsrs, doc(cfg(feature = "dns")))]
pub mod dns {
#[doc(inline)]
pub use libp2p_dns::*;
}
#[cfg(feature = "floodsub")]
#[cfg_attr(docsrs, doc(cfg(feature = "floodsub")))]
#[doc(inline)]
@ -79,14 +96,31 @@ pub use libp2p_identify as identify;
#[cfg_attr(docsrs, doc(cfg(feature = "kad")))]
#[doc(inline)]
pub use libp2p_kad as kad;
#[cfg(any(feature = "mdns-async-io", feature = "mdns-tokio"))]
#[deprecated(
since = "0.49.0",
note = "The `mdns-tokio` and `mdns-async-io` features are deprecated. Use the new `mdns` feature together with the `tokio` or `async-std` features."
)]
#[cfg(all(
any(feature = "mdns-async-io", feature = "mdns-tokio"),
not(feature = "mdns")
))]
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[cfg_attr(
docsrs,
doc(cfg(any(feature = "mdns-tokio", feature = "mdns-async-io")))
)]
pub mod mdns {
#[doc(inline)]
pub use libp2p_mdns::*;
}
#[cfg(feature = "mdns")]
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[doc(inline)]
pub use libp2p_mdns as mdns;
#[cfg_attr(docsrs, doc(cfg(feature = "mdns")))]
pub mod mdns {
#[doc(inline)]
pub use libp2p_mdns::*;
}
#[cfg(feature = "metrics")]
#[cfg_attr(docsrs, doc(cfg(feature = "metrics")))]
#[doc(inline)]
@ -125,11 +159,28 @@ pub use libp2p_rendezvous as rendezvous;
pub use libp2p_request_response as request_response;
#[doc(inline)]
pub use libp2p_swarm as swarm;
#[cfg(any(feature = "tcp-async-io", feature = "tcp-tokio"))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "tcp-async-io", feature = "tcp-tokio"))))]
#[deprecated(
since = "0.49.0",
note = "The `tcp-tokio` and `tcp-async-io` features are deprecated. Use the new `tcp` feature together with the `tokio` or `async-std` features."
)]
#[cfg(all(
any(feature = "tcp-tokio", feature = "tcp-async-io"),
not(feature = "tcp")
))]
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[doc(inline)]
pub use libp2p_tcp as tcp;
#[cfg_attr(docsrs, doc(cfg(any(feature = "tcp-tokio", feature = "tcp-async-io"))))]
pub mod tcp {
#[doc(inline)]
pub use libp2p_tcp::*;
}
#[cfg(feature = "tcp")]
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[cfg_attr(docsrs, doc(cfg(feature = "tcp")))]
pub mod tcp {
#[doc(inline)]
pub use libp2p_tcp::*;
}
#[cfg(feature = "uds")]
#[cfg_attr(docsrs, doc(cfg(feature = "uds")))]
#[doc(inline)]
@ -181,8 +232,10 @@ pub use libp2p_swarm_derive::NetworkBehaviour;
/// > reserves the right to support additional protocols or remove deprecated protocols.
#[cfg(all(
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")),
feature = "tcp-async-io",
feature = "dns-async-std",
any(
all(feature = "tcp-async-io", feature = "dns-async-std"),
all(feature = "tcp", feature = "dns", feature = "async-std")
),
feature = "websocket",
feature = "noise",
feature = "mplex",
@ -192,14 +245,26 @@ pub use libp2p_swarm_derive::NetworkBehaviour;
docsrs,
doc(cfg(all(
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")),
feature = "tcp-async-io",
feature = "dns-async-std",
any(
all(feature = "tcp-async-io", feature = "dns-async-std"),
all(feature = "tcp", feature = "dns", feature = "async-std")
),
feature = "websocket",
feature = "noise",
feature = "mplex",
feature = "yamux"
)))
)]
#[cfg_attr(
all(
any(feature = "tcp-async-io", feature = "dns-async-std"),
not(feature = "async-std")
),
deprecated(
since = "0.49.0",
note = "The `tcp-async-io` and `dns-async-std` features are deprecated. Use the new `tcp` and `dns` features together with the `async-std` feature."
)
)]
pub async fn development_transport(
keypair: identity::Keypair,
) -> std::io::Result<core::transport::Boxed<(PeerId, core::muxing::StreamMuxerBox)>> {
@ -241,8 +306,10 @@ pub async fn development_transport(
/// > reserves the right to support additional protocols or remove deprecated protocols.
#[cfg(all(
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")),
feature = "tcp-tokio",
feature = "dns-tokio",
any(
all(feature = "tcp-tokio", feature = "dns-tokio"),
all(feature = "tcp", feature = "dns", feature = "tokio")
),
feature = "websocket",
feature = "noise",
feature = "mplex",
@ -252,14 +319,26 @@ pub async fn development_transport(
docsrs,
doc(cfg(all(
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")),
feature = "tcp-tokio",
feature = "dns-tokio",
any(
all(feature = "tcp-tokio", feature = "dns-tokio"),
all(feature = "tcp", feature = "dns", feature = "tokio")
),
feature = "websocket",
feature = "noise",
feature = "mplex",
feature = "yamux"
)))
)]
#[cfg_attr(
all(
any(feature = "tcp-tokio", feature = "dns-tokio"),
not(feature = "tokio")
),
deprecated(
since = "0.49.0",
note = "The `tcp-tokio` and `dns-tokio` features are deprecated. Use the new `tcp` and `dns` feature together with the `tokio` feature."
)
)]
pub fn tokio_development_transport(
keypair: identity::Keypair,
) -> std::io::Result<core::transport::Boxed<(PeerId, core::muxing::StreamMuxerBox)>> {