mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 15:21:33 +00:00
*: Use auto_doc_cfg
instead of doc(cfg)
attributes (#2983)
Co-authored-by: João Oliveira <hello@jxs.pt> Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
10
Cargo.toml
10
Cargo.toml
@ -78,9 +78,6 @@ serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"]
|
||||
tokio = ["libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio"]
|
||||
async-std = ["libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
||||
[dependencies]
|
||||
bytes = "1"
|
||||
futures = "0.3.1"
|
||||
@ -204,3 +201,10 @@ required-features = ["full"]
|
||||
[[example]]
|
||||
name = "distributed-key-value-store"
|
||||
required-features = ["full"]
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -64,3 +64,10 @@ serde = ["multihash/serde-codec", "dep:serde"]
|
||||
[[bench]]
|
||||
name = "peer_id"
|
||||
harness = false
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -35,6 +35,8 @@
|
||||
//! define how to upgrade each individual substream to use a protocol.
|
||||
//! See the `upgrade` module.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
mod keys_proto {
|
||||
include!(concat!(env!("OUT_DIR"), "/keys_proto.rs"));
|
||||
|
@ -38,3 +38,10 @@ futures = "0.3.1"
|
||||
libp2p = { path = "../..", features = ["full"] }
|
||||
hyper = { version="0.14", features = ["server", "tcp", "http1"] }
|
||||
tokio = { version = "1", features = ["rt-multi-thread"] }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -25,6 +25,8 @@
|
||||
//!
|
||||
//! See `examples` directory for more.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
#[cfg(feature = "dcutr")]
|
||||
mod dcutr;
|
||||
#[cfg(feature = "gossipsub")]
|
||||
|
@ -25,3 +25,10 @@ libp2p = { path = "../..", features = ["full"] }
|
||||
quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" }
|
||||
rand = "0.8"
|
||||
rw-stream-sink = { version = "0.3.0", path = "../../misc/rw-stream-sink" }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -87,6 +87,8 @@
|
||||
//! ```
|
||||
//!
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod dialer_select;
|
||||
mod length_delimited;
|
||||
mod listener_select;
|
||||
|
@ -19,3 +19,10 @@ unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
|
||||
|
||||
[dev-dependencies]
|
||||
prost-build = "0.11"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -1,3 +1,5 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use asynchronous_codec::{Decoder, Encoder};
|
||||
use bytes::BytesMut;
|
||||
use prost::Message;
|
||||
|
@ -1,3 +1,5 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub use quickcheck::*;
|
||||
|
||||
use core::ops::Range;
|
||||
|
@ -16,3 +16,10 @@ static_assertions = "1"
|
||||
|
||||
[dev-dependencies]
|
||||
async-std = "1.0"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -25,6 +25,8 @@
|
||||
//! Each call to [`AsyncWrite::poll_write`] will send one packet to the sink.
|
||||
//! Calls to [`AsyncRead::poll_read`] will read from the stream's incoming packets.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use futures::{prelude::*, ready};
|
||||
use std::{
|
||||
io::{self, Read},
|
||||
|
@ -34,3 +34,10 @@ quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" }
|
||||
[[bench]]
|
||||
name = "split_send_size"
|
||||
harness = false
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -18,6 +18,8 @@
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod codec;
|
||||
mod config;
|
||||
mod io;
|
||||
|
@ -21,3 +21,10 @@ log = "0.4"
|
||||
[dev-dependencies]
|
||||
async-std = { version = "1.7.0", features = ["attributes"] }
|
||||
libp2p-muxer-test-harness = { path = "../test-harness" }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -21,6 +21,8 @@
|
||||
//! Implements the Yamux multiplexing protocol for libp2p, see also the
|
||||
//! [specification](https://github.com/hashicorp/yamux/blob/master/spec.md).
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use futures::{
|
||||
future,
|
||||
prelude::*,
|
||||
|
@ -30,3 +30,10 @@ async-std = { version = "1.10", features = ["attributes"] }
|
||||
env_logger = "0.9"
|
||||
clap = { version = "4.0.13", features = ["derive"] }
|
||||
libp2p = { path = "../..", features = ["full"] }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -19,6 +19,9 @@
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
//! Implementation of the AutoNAT protocol.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod behaviour;
|
||||
mod protocol;
|
||||
|
||||
|
@ -33,3 +33,10 @@ env_logger = "0.9.0"
|
||||
libp2p = { path = "../..", features = ["full"] }
|
||||
rand = "0.8"
|
||||
clap = { version = "4.0.13", features = ["derive"] }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -21,6 +21,8 @@
|
||||
//! Implementation of the [libp2p Direct Connection Upgrade through Relay
|
||||
//! specification](https://github.com/libp2p/specs/blob/master/relay/DCUtR.md).
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub mod behaviour;
|
||||
mod handler;
|
||||
mod protocol;
|
||||
|
@ -23,3 +23,10 @@ smallvec = "1.6.1"
|
||||
|
||||
[build-dependencies]
|
||||
prost-build = "0.11"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -21,6 +21,8 @@
|
||||
//! Implements the floodsub protocol, see also the:
|
||||
//! [spec](https://github.com/libp2p/specs/tree/master/pubsub).
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use libp2p_core::PeerId;
|
||||
|
||||
pub mod protocol;
|
||||
|
@ -43,3 +43,10 @@ derive_builder = "0.11.1"
|
||||
|
||||
[build-dependencies]
|
||||
prost-build = "0.11"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -133,6 +133,8 @@
|
||||
//! println!("Listening on {:?}", addr);
|
||||
//! ```
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub mod error;
|
||||
pub mod protocol;
|
||||
|
||||
|
@ -31,3 +31,10 @@ libp2p = { path = "../..", features = ["full"] }
|
||||
|
||||
[build-dependencies]
|
||||
prost-build = "0.11"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -39,6 +39,8 @@
|
||||
//! that negotiates and executes the protocol on every established connection, emitting
|
||||
//! [`Event`]s.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub use self::behaviour::{Behaviour, Config, Event};
|
||||
pub use self::protocol::{Info, UpgradeError, PROTOCOL_NAME, PUSH_PROTOCOL_NAME};
|
||||
|
||||
|
@ -43,3 +43,10 @@ prost-build = "0.11"
|
||||
|
||||
[features]
|
||||
serde = ["dep:serde", "bytes/serde"]
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -38,6 +38,7 @@
|
||||
// TODO: we allow dead_code for now because this library contains a lot of unused code that will
|
||||
// be useful later for record store
|
||||
#![allow(dead_code)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub mod handler;
|
||||
pub mod kbucket;
|
||||
|
@ -45,3 +45,10 @@ required-features = ["async-io"]
|
||||
name = "use-tokio"
|
||||
required-features = ["tokio"]
|
||||
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -30,6 +30,9 @@
|
||||
//! implements the `NetworkBehaviour` trait. This struct will automatically discover other
|
||||
//! libp2p nodes on the local network.
|
||||
//!
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use std::net::{Ipv4Addr, Ipv6Addr};
|
||||
use std::time::Duration;
|
||||
|
||||
|
@ -24,3 +24,10 @@ void = "1.0"
|
||||
async-std = "1.6.2"
|
||||
libp2p = { path = "../..", features = ["full"] }
|
||||
quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -40,6 +40,8 @@
|
||||
//! [`Swarm`]: libp2p_swarm::Swarm
|
||||
//! [`Transport`]: libp2p_core::Transport
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod handler;
|
||||
mod protocol;
|
||||
|
||||
|
@ -37,3 +37,10 @@ env_logger = "0.9.0"
|
||||
libp2p = { path = "../..", features = ["full"] }
|
||||
quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" }
|
||||
clap = { version = "4.0.13", features = ["derive"] }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
//! libp2p circuit relay implementations
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub mod v2;
|
||||
|
||||
// Check that we can safely cast a `usize` to a `u64`.
|
||||
|
@ -35,3 +35,10 @@ tokio = { version = "1.15", features = [ "rt-multi-thread", "time", "macros", "s
|
||||
|
||||
[build-dependencies]
|
||||
prost-build = "0.11"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -18,6 +18,8 @@
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub use self::codec::{Cookie, ErrorCode, Namespace, NamespaceTooLong, Registration, Ttl};
|
||||
|
||||
mod codec;
|
||||
|
@ -27,3 +27,10 @@ async-std = "1.6.2"
|
||||
env_logger = "0.9.0"
|
||||
libp2p = { path = "../..", features = ["full"] }
|
||||
rand = "0.8"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -56,6 +56,8 @@
|
||||
//! advertised during inbound respectively outbound protocol negotiation
|
||||
//! on the substreams.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub mod codec;
|
||||
pub mod handler;
|
||||
|
||||
|
49
src/lib.rs
49
src/lib.rs
@ -31,6 +31,7 @@
|
||||
|
||||
#![doc(html_logo_url = "https://libp2p.io/img/logo_small.png")]
|
||||
#![doc(html_favicon_url = "https://libp2p.io/img/favicon.png")]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub use bytes;
|
||||
pub use futures;
|
||||
@ -40,17 +41,14 @@ pub use libp2p_core::multihash;
|
||||
pub use multiaddr;
|
||||
|
||||
#[cfg(feature = "autonat")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "autonat")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_autonat as autonat;
|
||||
#[doc(inline)]
|
||||
pub use libp2p_core as core;
|
||||
#[cfg(feature = "dcutr")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "dcutr")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_dcutr as dcutr;
|
||||
#[cfg(feature = "deflate")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "deflate")))]
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_deflate as deflate;
|
||||
@ -60,20 +58,16 @@ pub use libp2p_deflate as deflate;
|
||||
#[doc(inline)]
|
||||
pub use libp2p_dns as dns;
|
||||
#[cfg(feature = "floodsub")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "floodsub")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_floodsub as floodsub;
|
||||
#[cfg(feature = "gossipsub")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gossipsub")))]
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_gossipsub as gossipsub;
|
||||
#[cfg(feature = "identify")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "identify")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_identify as identify;
|
||||
#[cfg(feature = "kad")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "kad")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_kad as kad;
|
||||
#[cfg(feature = "mdns")]
|
||||
@ -82,39 +76,30 @@ pub use libp2p_kad as kad;
|
||||
#[doc(inline)]
|
||||
pub use libp2p_mdns as mdns;
|
||||
#[cfg(feature = "metrics")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "metrics")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_metrics as metrics;
|
||||
#[cfg(feature = "mplex")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "mplex")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_mplex as mplex;
|
||||
#[cfg(feature = "noise")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "noise")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_noise as noise;
|
||||
#[cfg(feature = "ping")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "ping")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_ping as ping;
|
||||
#[cfg(feature = "plaintext")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "plaintext")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_plaintext as plaintext;
|
||||
#[cfg(feature = "pnet")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "pnet")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_pnet as pnet;
|
||||
#[cfg(feature = "relay")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "relay")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_relay as relay;
|
||||
#[cfg(feature = "rendezvous")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "rendezvous")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_rendezvous as rendezvous;
|
||||
#[cfg(feature = "request-response")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "request-response")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_request_response as request_response;
|
||||
#[doc(inline)]
|
||||
@ -129,20 +114,16 @@ pub use libp2p_tcp as tcp;
|
||||
#[doc(inline)]
|
||||
pub use libp2p_tls as tls;
|
||||
#[cfg(feature = "uds")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "uds")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_uds as uds;
|
||||
#[cfg(feature = "wasm-ext")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "wasm-ext")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_wasm_ext as wasm_ext;
|
||||
#[cfg(feature = "websocket")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "websocket")))]
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_websocket as websocket;
|
||||
#[cfg(feature = "yamux")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "yamux")))]
|
||||
#[doc(inline)]
|
||||
pub use libp2p_yamux as yamux;
|
||||
|
||||
@ -188,20 +169,6 @@ pub use libp2p_swarm_derive::NetworkBehaviour;
|
||||
feature = "mplex",
|
||||
feature = "yamux"
|
||||
))]
|
||||
#[cfg_attr(
|
||||
docsrs,
|
||||
doc(cfg(all(
|
||||
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")),
|
||||
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"),
|
||||
@ -262,20 +229,6 @@ pub async fn development_transport(
|
||||
feature = "mplex",
|
||||
feature = "yamux"
|
||||
))]
|
||||
#[cfg_attr(
|
||||
docsrs,
|
||||
doc(cfg(all(
|
||||
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")),
|
||||
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"),
|
||||
|
@ -23,3 +23,10 @@ libp2p = { path = "..", features = ["full"] }
|
||||
either = "1.6.0"
|
||||
futures = "0.3.1"
|
||||
void = "1"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -19,6 +19,7 @@
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#![recursion_limit = "256"]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use heck::ToUpperCamelCase;
|
||||
use proc_macro::TokenStream;
|
||||
|
@ -29,3 +29,10 @@ async-std = { version = "1.6.2", features = ["attributes"] }
|
||||
env_logger = "0.9"
|
||||
libp2p = { path = "..", features = ["full"] }
|
||||
quickcheck = { package = "quickcheck-ext", path = "../misc/quickcheck-ext" }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -53,6 +53,8 @@
|
||||
//! are supported, when to open a new outbound substream, etc.
|
||||
//!
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod connection;
|
||||
mod registry;
|
||||
#[cfg(test)]
|
||||
|
@ -20,3 +20,10 @@ async-std = "1.6.2"
|
||||
libp2p = { path = "../..", features = ["full"] }
|
||||
quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" }
|
||||
rand = "0.8"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -18,6 +18,8 @@
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use futures::{prelude::*, ready};
|
||||
use libp2p_core::{InboundUpgrade, OutboundUpgrade, UpgradeInfo};
|
||||
use std::{io, iter, pin::Pin, task::Context, task::Poll};
|
||||
|
@ -32,3 +32,10 @@ tokio = ["trust-dns-resolver/tokio-runtime"]
|
||||
# available for `tokio`.
|
||||
tokio-dns-over-rustls = ["tokio", "trust-dns-resolver/dns-over-rustls"]
|
||||
tokio-dns-over-https-rustls = ["tokio", "trust-dns-resolver/dns-over-https-rustls"]
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -54,6 +54,8 @@
|
||||
//!
|
||||
//![trust-dns-resolver]: https://docs.rs/trust-dns-resolver/latest/trust_dns_resolver/#dns-over-tls-and-dns-over-https
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
#[cfg(feature = "async-std")]
|
||||
use async_std_resolver::{AsyncStdConnection, AsyncStdConnectionProvider};
|
||||
use futures::{future::BoxFuture, prelude::*};
|
||||
|
@ -38,3 +38,10 @@ ed25519-compact = "2.0.2"
|
||||
|
||||
[build-dependencies]
|
||||
prost-build = "0.11"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -53,6 +53,8 @@
|
||||
//!
|
||||
//! [noise]: http://noiseprotocol.org/
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod error;
|
||||
mod io;
|
||||
mod protocol;
|
||||
|
@ -27,3 +27,10 @@ rand = "0.8"
|
||||
|
||||
[build-dependencies]
|
||||
prost-build = "0.11"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -18,6 +18,8 @@
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use crate::error::PlainTextError;
|
||||
|
||||
use bytes::Bytes;
|
||||
|
@ -20,3 +20,10 @@ pin-project = "1.0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -23,6 +23,9 @@
|
||||
//!
|
||||
//! Libp2p nodes configured with a pre-shared key can only communicate with other nodes with
|
||||
//! the same key.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod crypt_writer;
|
||||
use crypt_writer::CryptWriter;
|
||||
use futures::prelude::*;
|
||||
|
@ -29,3 +29,10 @@ async-io = ["async-io-crate"]
|
||||
async-std = { version = "1.6.5", features = ["attributes"] }
|
||||
tokio-crate = { package = "tokio", version = "1.0.1", default-features = false, features = ["net", "rt", "macros"] }
|
||||
env_logger = "0.9.0"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -26,6 +26,8 @@
|
||||
//! the enabled features, which implement the `Transport` trait for use as a
|
||||
//! transport with `libp2p-core` or `libp2p-swarm`.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod provider;
|
||||
|
||||
use if_watch::{IfEvent, IfWatcher};
|
||||
|
@ -19,3 +19,10 @@ tokio = { version = "1.15", default-features = false, features = ["net"], option
|
||||
|
||||
[target.'cfg(all(unix, not(target_os = "emscripten")))'.dev-dependencies]
|
||||
tempfile = "3.0"
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -36,7 +36,7 @@
|
||||
not(target_os = "emscripten"),
|
||||
any(feature = "tokio", feature = "async-std")
|
||||
))]
|
||||
#![cfg_attr(docsrs, doc(cfg(all(unix, not(target_os = "emscripten")))))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use futures::stream::BoxStream;
|
||||
use futures::{
|
||||
@ -66,7 +66,6 @@ pub type Listener<T> = BoxStream<
|
||||
macro_rules! codegen {
|
||||
($feature_name:expr, $uds_config:ident, $build_listener:expr, $unix_stream:ty, $($mut_or_not:tt)*) => {
|
||||
/// Represents the configuration for a Unix domain sockets transport capability for libp2p.
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = $feature_name)))]
|
||||
pub struct $uds_config {
|
||||
listeners: VecDeque<(ListenerId, Listener<Self>)>,
|
||||
}
|
||||
|
@ -20,3 +20,10 @@ wasm-bindgen-futures = "0.4.4"
|
||||
|
||||
[features]
|
||||
websocket = []
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -32,6 +32,8 @@
|
||||
//! module.
|
||||
//!
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use futures::{future::Ready, prelude::*, ready, stream::SelectAll};
|
||||
use libp2p_core::{
|
||||
connection::Endpoint,
|
||||
|
@ -25,3 +25,10 @@ webpki-roots = "0.22"
|
||||
|
||||
[dev-dependencies]
|
||||
libp2p = { path = "../..", features = ["full"] }
|
||||
|
||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||
# More information: https://docs.rs/about/builds#cross-compiling
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
//! Implementation of the libp2p `Transport` trait for Websockets.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub mod error;
|
||||
pub mod framed;
|
||||
pub mod tls;
|
||||
|
Reference in New Issue
Block a user