diff --git a/core/src/transport.rs b/core/src/transport.rs index c9861297..9aeddb72 100644 --- a/core/src/transport.rs +++ b/core/src/transport.rs @@ -135,7 +135,7 @@ pub trait Transport { /// /// This option is needed for NAT and firewall hole punching. /// - /// See [`ConnectedPoint::Dialer`](crate::connection::ConnectedPoint::Dialer) for related option. + /// See [`ConnectedPoint::Dialer`] for related option. fn dial_as_listener( &mut self, addr: Multiaddr, @@ -235,8 +235,7 @@ pub trait Transport { and_then::AndThen::new(self, f) } - /// Begins a series of protocol upgrades via an - /// [`upgrade::Builder`](upgrade::Builder). + /// Begins a series of protocol upgrades via an [`upgrade::Builder`]. fn upgrade(self, version: upgrade::Version) -> upgrade::Builder where Self: Sized, diff --git a/libp2p/src/lib.rs b/libp2p/src/lib.rs index d1e151cc..e3934e6b 100644 --- a/libp2p/src/lib.rs +++ b/libp2p/src/lib.rs @@ -20,12 +20,10 @@ //! libp2p is a modular peer-to-peer networking framework. //! -//! To learn more about the general libp2p multi-language framework visit -//! [libp2p.io](https://libp2p.io/). +//! To learn more about the general libp2p multi-language framework visit . //! -//! To get started with this libp2p implementation in Rust, please take a look -//! at the [`tutorials`](crate::tutorials). Further examples can be found in the -//! [examples] directory. +//! To get started with this libp2p implementation in Rust, please take a look at the [`tutorials`]. +//! Further examples can be found in the [examples] directory. //! //! [examples]: https://github.com/libp2p/rust-libp2p/tree/master/examples diff --git a/misc/connection-limits/src/lib.rs b/misc/connection-limits/src/lib.rs index 7de96cc1..880904f7 100644 --- a/misc/connection-limits/src/lib.rs +++ b/misc/connection-limits/src/lib.rs @@ -37,7 +37,7 @@ use void::Void; /// If a connection is denied due to a limit, either a [`SwarmEvent::IncomingConnectionError`](libp2p_swarm::SwarmEvent::IncomingConnectionError) /// or [`SwarmEvent::OutgoingConnectionError`](libp2p_swarm::SwarmEvent::OutgoingConnectionError) will be emitted. /// The [`ListenError::Denied`](libp2p_swarm::ListenError::Denied) and respectively the [`DialError::Denied`](libp2p_swarm::DialError::Denied) variant -/// contain a [`ConnectionDenied`](libp2p_swarm::ConnectionDenied) type that can be downcast to [`Exceeded`] error if (and only if) **this** +/// contain a [`ConnectionDenied`] type that can be downcast to [`Exceeded`] error if (and only if) **this** /// behaviour denied the connection. /// /// If you employ multiple [`NetworkBehaviour`]s that manage connections, it may also be a different error. diff --git a/misc/memory-connection-limits/src/lib.rs b/misc/memory-connection-limits/src/lib.rs index 33e40b11..36f0d164 100644 --- a/misc/memory-connection-limits/src/lib.rs +++ b/misc/memory-connection-limits/src/lib.rs @@ -39,7 +39,7 @@ use std::{ /// If a connection is denied due to a limit, either a [`SwarmEvent::IncomingConnectionError`](libp2p_swarm::SwarmEvent::IncomingConnectionError) /// or [`SwarmEvent::OutgoingConnectionError`](libp2p_swarm::SwarmEvent::OutgoingConnectionError) will be emitted. /// The [`ListenError::Denied`](libp2p_swarm::ListenError::Denied) and respectively the [`DialError::Denied`](libp2p_swarm::DialError::Denied) variant -/// contain a [`ConnectionDenied`](libp2p_swarm::ConnectionDenied) type that can be downcast to [`MemoryUsageLimitExceeded`] error if (and only if) **this** +/// contain a [`ConnectionDenied`] type that can be downcast to [`MemoryUsageLimitExceeded`] error if (and only if) **this** /// behaviour denied the connection. /// /// If you employ multiple [`NetworkBehaviour`]s that manage connections, it may also be a different error. diff --git a/misc/multistream-select/src/lib.rs b/misc/multistream-select/src/lib.rs index ec62023a..e85fae0f 100644 --- a/misc/multistream-select/src/lib.rs +++ b/misc/multistream-select/src/lib.rs @@ -40,13 +40,12 @@ //! echoing the same protocol) or reject (by responding with a message stating //! "not available"). If a suggested protocol is not available, the dialer may //! suggest another protocol. This process continues until a protocol is agreed upon, -//! yielding a [`Negotiated`](self::Negotiated) stream, or the dialer has run out of +//! yielding a [`Negotiated`] stream, or the dialer has run out of //! alternatives. //! -//! See [`dialer_select_proto`](self::dialer_select_proto) and -//! [`listener_select_proto`](self::listener_select_proto). +//! See [`dialer_select_proto`] and [`listener_select_proto`]. //! -//! ## [`Negotiated`](self::Negotiated) +//! ## [`Negotiated`] //! //! A `Negotiated` represents an I/O stream that has settled on a protocol //! to use. By default, with [`Version::V1`], protocol negotiation is always @@ -55,7 +54,7 @@ //! a variant [`Version::V1Lazy`] that permits 0-RTT negotiation if the //! dialer only supports a single protocol. In that case, when a dialer //! settles on a protocol to use, the [`DialerSelectFuture`] yields a -//! [`Negotiated`](self::Negotiated) I/O stream before the negotiation +//! [`Negotiated`] I/O stream before the negotiation //! data has been flushed. It is then expecting confirmation for that protocol //! as the first messages read from the stream. This behaviour allows the dialer //! to immediately send data relating to the negotiated protocol together with the @@ -63,8 +62,7 @@ //! multiple 0-RTT negotiations in sequence for different protocols layered on //! top of each other may trigger undesirable behaviour for a listener not //! supporting one of the intermediate protocols. See -//! [`dialer_select_proto`](self::dialer_select_proto) and the documentation -//! of [`Version::V1Lazy`] for further details. +//! [`dialer_select_proto`] and the documentation of [`Version::V1Lazy`] for further details. //! //! ## Examples //! diff --git a/swarm/src/behaviour.rs b/swarm/src/behaviour.rs index d80f5f0c..3662bf5c 100644 --- a/swarm/src/behaviour.rs +++ b/swarm/src/behaviour.rs @@ -144,7 +144,7 @@ pub trait NetworkBehaviour: 'static { /// This is invoked once another peer has successfully dialed us. /// /// At this point, we have verified their [`PeerId`] and we know, which particular [`Multiaddr`] succeeded in the dial. - /// In order to actually use this connection, this function must return a [`ConnectionHandler`](crate::ConnectionHandler). + /// In order to actually use this connection, this function must return a [`ConnectionHandler`]. /// Returning an error will immediately close the connection. fn handle_established_inbound_connection( &mut self, @@ -180,7 +180,7 @@ pub trait NetworkBehaviour: 'static { /// /// This is invoked once we have successfully dialed a peer. /// At this point, we have verified their [`PeerId`] and we know, which particular [`Multiaddr`] succeeded in the dial. - /// In order to actually use this connection, this function must return a [`ConnectionHandler`](crate::ConnectionHandler). + /// In order to actually use this connection, this function must return a [`ConnectionHandler`]. /// Returning an error will immediately close the connection. fn handle_established_outbound_connection( &mut self, @@ -193,7 +193,7 @@ pub trait NetworkBehaviour: 'static { /// Informs the behaviour about an event from the [`Swarm`](crate::Swarm). fn on_swarm_event(&mut self, event: FromSwarm); - /// Informs the behaviour about an event generated by the [`ConnectionHandler`](crate::ConnectionHandler) + /// Informs the behaviour about an event generated by the [`ConnectionHandler`] /// dedicated to the peer identified by `peer_id`. for the behaviour. /// /// The [`PeerId`] is guaranteed to be in a connected state. In other words, @@ -260,20 +260,20 @@ pub enum ToSwarm { /// Instructs the `Swarm` to send an event to the handler dedicated to a /// connection with a peer. /// - /// If the `Swarm` is connected to the peer, the message is delivered to the - /// [`ConnectionHandler`](crate::ConnectionHandler) instance identified by the peer ID and connection ID. + /// If the `Swarm` is connected to the peer, the message is delivered to the [`ConnectionHandler`] + /// instance identified by the peer ID and connection ID. /// /// If the specified connection no longer exists, the event is silently dropped. /// /// Typically the connection ID given is the same as the one passed to /// [`NetworkBehaviour::on_connection_handler_event`], i.e. whenever the behaviour wishes to /// respond to a request on the same connection (and possibly the same - /// substream, as per the implementation of [`ConnectionHandler`](crate::ConnectionHandler)). + /// substream, as per the implementation of [`ConnectionHandler`]). /// /// Note that even if the peer is currently connected, connections can get closed /// at any time and thus the event may not reach a handler. NotifyHandler { - /// The peer for whom a [`ConnectionHandler`](crate::ConnectionHandler) should be notified. + /// The peer for whom a [`ConnectionHandler`] should be notified. peer_id: PeerId, /// The options w.r.t. which connection handler to notify of the event. handler: NotifyHandler, @@ -309,10 +309,10 @@ pub enum ToSwarm { /// /// Note: Closing a connection via /// [`ToSwarm::CloseConnection`] does not inform the - /// corresponding [`ConnectionHandler`](crate::ConnectionHandler). - /// Closing a connection via a [`ConnectionHandler`](crate::ConnectionHandler) can be done - /// either in a collaborative manner across [`ConnectionHandler`](crate::ConnectionHandler)s - /// with [`ConnectionHandler::connection_keep_alive`](crate::ConnectionHandler::connection_keep_alive) or directly with + /// corresponding [`ConnectionHandler`]. + /// Closing a connection via a [`ConnectionHandler`] can be done + /// either in a collaborative manner across [`ConnectionHandler`]s + /// with [`ConnectionHandler::connection_keep_alive`] or directly with /// [`ConnectionHandlerEvent::Close`](crate::ConnectionHandlerEvent::Close). CloseConnection { /// The peer to disconnect. diff --git a/swarm/src/connection.rs b/swarm/src/connection.rs index d99319cf..97251039 100644 --- a/swarm/src/connection.rs +++ b/swarm/src/connection.rs @@ -144,8 +144,7 @@ where /// Note: This only enforces a limit on the number of concurrently /// negotiating inbound streams. The total number of inbound streams on a /// connection is the sum of negotiating and negotiated streams. A limit on - /// the total number of streams can be enforced at the - /// [`StreamMuxerBox`](libp2p_core::muxing::StreamMuxerBox) level. + /// the total number of streams can be enforced at the [`StreamMuxerBox`] level. max_negotiating_inbound_streams: usize, /// Contains all upgrades that are waiting for a new outbound substream. /// diff --git a/swarm/src/connection/pool.rs b/swarm/src/connection/pool.rs index 07fc9075..b6100989 100644 --- a/swarm/src/connection/pool.rs +++ b/swarm/src/connection/pool.rs @@ -981,7 +981,7 @@ impl PoolConfig { /// delivery to the connection handler. /// /// When the buffer for a particular connection is full, `notify_handler` will no - /// longer be able to deliver events to the associated [`Connection`](super::Connection), + /// longer be able to deliver events to the associated [`Connection`], /// thus exerting back-pressure on the connection and peer API. pub(crate) fn with_notify_handler_buffer_size(mut self, n: NonZeroUsize) -> Self { self.task_command_buffer_size = n.get() - 1; diff --git a/swarm/src/lib.rs b/swarm/src/lib.rs index 22433d22..b81dcff8 100644 --- a/swarm/src/lib.rs +++ b/swarm/src/lib.rs @@ -159,8 +159,7 @@ use std::{ /// Substream for which a protocol has been chosen. /// -/// Implements the [`AsyncRead`](futures::io::AsyncRead) and -/// [`AsyncWrite`](futures::io::AsyncWrite) traits. +/// Implements the [`AsyncRead`] and [`AsyncWrite`] traits. #[deprecated(note = "The 'substream' terminology is deprecated. Use 'Stream' instead")] pub type NegotiatedSubstream = Stream; @@ -1515,8 +1514,7 @@ where /// Note: This only enforces a limit on the number of concurrently /// negotiating inbound streams. The total number of inbound streams on a /// connection is the sum of negotiating and negotiated streams. A limit on - /// the total number of streams can be enforced at the - /// [`StreamMuxerBox`](libp2p_core::muxing::StreamMuxerBox) level. + /// the total number of streams can be enforced at the [`StreamMuxerBox`] level. pub fn max_negotiating_inbound_streams(mut self, v: usize) -> Self { self.pool_config = self.pool_config.with_max_negotiating_inbound_streams(v); self