Improve doc aesthetics (#850)

This commit is contained in:
Pierre Krieger
2019-01-14 14:10:51 +01:00
committed by GitHub
parent 56c9e57fbd
commit 60db872c31
4 changed files with 37 additions and 19 deletions

View File

@ -1,5 +1,6 @@
[package] [package]
name = "libp2p" name = "libp2p"
edition = "2018"
description = "Peer-to-peer networking library" description = "Peer-to-peer networking library"
version = "0.2.0" version = "0.2.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -109,7 +109,7 @@
//! The `Swarm` struct contains all active and pending connections to remotes and manages the //! The `Swarm` struct contains all active and pending connections to remotes and manages the
//! state of all the substreams that have been opened, and all the upgrades that were built upon //! state of all the substreams that have been opened, and all the upgrades that were built upon
//! these substreams. //! these substreams.
//! //!
//! It combines a `Transport`, a `NetworkBehaviour` and a `Topology` together. //! It combines a `Transport`, a `NetworkBehaviour` and a `Topology` together.
//! //!
//! See the documentation of the `libp2p-core` crate for more details about creating a swarm. //! See the documentation of the `libp2p-core` crate for more details about creating a swarm.
@ -129,6 +129,9 @@
//! - This swarm can now be polled with the `tokio` library in order to start the network. //! - This swarm can now be polled with the `tokio` library in order to start the network.
//! //!
#![doc(html_logo_url = "https://libp2p.io/img/logo_small.png")]
#![doc(html_favicon_url = "https://libp2p.io/img/favicon.png")]
pub extern crate bytes; pub extern crate bytes;
pub extern crate futures; pub extern crate futures;
pub extern crate multiaddr; pub extern crate multiaddr;
@ -139,25 +142,40 @@ pub extern crate tokio_codec;
extern crate libp2p_core_derive; extern crate libp2p_core_derive;
extern crate tokio_executor; extern crate tokio_executor;
pub extern crate libp2p_core as core; #[doc(inline)]
pub use libp2p_core as core;
#[cfg(not(any(target_os = "emscripten", target_os = "unknown")))] #[cfg(not(any(target_os = "emscripten", target_os = "unknown")))]
pub extern crate libp2p_dns as dns; #[doc(inline)]
pub extern crate libp2p_identify as identify; pub use libp2p_dns as dns;
pub extern crate libp2p_kad as kad; #[doc(inline)]
pub extern crate libp2p_floodsub as floodsub; pub use libp2p_identify as identify;
pub extern crate libp2p_mplex as mplex; #[doc(inline)]
pub use libp2p_kad as kad;
#[doc(inline)]
pub use libp2p_floodsub as floodsub;
#[doc(inline)]
pub use libp2p_mplex as mplex;
#[cfg(not(any(target_os = "emscripten", target_os = "unknown")))] #[cfg(not(any(target_os = "emscripten", target_os = "unknown")))]
pub extern crate libp2p_mdns as mdns; #[doc(inline)]
pub extern crate libp2p_ping as ping; pub use libp2p_mdns as mdns;
pub extern crate libp2p_plaintext as plaintext; #[doc(inline)]
pub extern crate libp2p_ratelimit as ratelimit; pub use libp2p_ping as ping;
pub extern crate libp2p_secio as secio; #[doc(inline)]
pub use libp2p_plaintext as plaintext;
#[doc(inline)]
pub use libp2p_ratelimit as ratelimit;
#[doc(inline)]
pub use libp2p_secio as secio;
#[cfg(not(any(target_os = "emscripten", target_os = "unknown")))] #[cfg(not(any(target_os = "emscripten", target_os = "unknown")))]
pub extern crate libp2p_tcp as tcp; #[doc(inline)]
pub extern crate libp2p_uds as uds; pub use libp2p_tcp as tcp;
#[doc(inline)]
pub use libp2p_uds as uds;
#[cfg(feature = "libp2p-websocket")] #[cfg(feature = "libp2p-websocket")]
pub extern crate libp2p_websocket as websocket; #[doc(inline)]
pub extern crate libp2p_yamux as yamux; pub use libp2p_websocket as websocket;
#[doc(inline)]
pub use libp2p_yamux as yamux;
mod transport_ext; mod transport_ext;

View File

@ -18,8 +18,8 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
use crate::core::upgrade::{InboundUpgrade, OutboundUpgrade, UpgradeInfo};
use bytes::Bytes; use bytes::Bytes;
use core::upgrade::{InboundUpgrade, OutboundUpgrade, UpgradeInfo};
use futures::{future::FromErr, prelude::*}; use futures::{future::FromErr, prelude::*};
use std::{iter, io::Error as IoError, sync::Arc}; use std::{iter, io::Error as IoError, sync::Arc};
use tokio_io::{AsyncRead, AsyncWrite}; use tokio_io::{AsyncRead, AsyncWrite};

View File

@ -20,10 +20,9 @@
//! Provides the `TransportExt` trait. //! Provides the `TransportExt` trait.
use ratelimit::RateLimited; use crate::{ratelimit::RateLimited, Transport};
use std::io; use std::io;
use tokio_executor::DefaultExecutor; use tokio_executor::DefaultExecutor;
use Transport;
/// Trait automatically implemented on all objects that implement `Transport`. Provides some /// Trait automatically implemented on all objects that implement `Transport`. Provides some
/// additional utilities. /// additional utilities.