fix: remove redundant intra-doc link

The recent Rust release introduced a new rustdoc lint which is currently failing CI.

Pull-Request: #4602.
This commit is contained in:
Thomas Eizinger
2023-10-09 11:58:32 +11:00
committed by GitHub
parent 7d1d67cad3
commit b6a1398060
9 changed files with 27 additions and 35 deletions

View File

@ -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<Self>
where
Self: Sized,

View File

@ -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 <https://libp2p.io>.
//!
//! 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

View File

@ -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.

View File

@ -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.

View File

@ -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
//!

View File

@ -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<Self::ConnectionHandler>);
/// 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<TOutEvent, TInEvent> {
/// 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<TOutEvent, TInEvent> {
///
/// 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.

View File

@ -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.
///

View File

@ -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;

View File

@ -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