mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 09:11:34 +00:00
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:
@ -135,7 +135,7 @@ pub trait Transport {
|
|||||||
///
|
///
|
||||||
/// This option is needed for NAT and firewall hole punching.
|
/// 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(
|
fn dial_as_listener(
|
||||||
&mut self,
|
&mut self,
|
||||||
addr: Multiaddr,
|
addr: Multiaddr,
|
||||||
@ -235,8 +235,7 @@ pub trait Transport {
|
|||||||
and_then::AndThen::new(self, f)
|
and_then::AndThen::new(self, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Begins a series of protocol upgrades via an
|
/// Begins a series of protocol upgrades via an [`upgrade::Builder`].
|
||||||
/// [`upgrade::Builder`](upgrade::Builder).
|
|
||||||
fn upgrade(self, version: upgrade::Version) -> upgrade::Builder<Self>
|
fn upgrade(self, version: upgrade::Version) -> upgrade::Builder<Self>
|
||||||
where
|
where
|
||||||
Self: Sized,
|
Self: Sized,
|
||||||
|
@ -20,12 +20,10 @@
|
|||||||
|
|
||||||
//! libp2p is a modular peer-to-peer networking framework.
|
//! libp2p is a modular peer-to-peer networking framework.
|
||||||
//!
|
//!
|
||||||
//! To learn more about the general libp2p multi-language framework visit
|
//! To learn more about the general libp2p multi-language framework visit <https://libp2p.io>.
|
||||||
//! [libp2p.io](https://libp2p.io/).
|
|
||||||
//!
|
//!
|
||||||
//! To get started with this libp2p implementation in Rust, please take a look
|
//! To get started with this libp2p implementation in Rust, please take a look at the [`tutorials`].
|
||||||
//! at the [`tutorials`](crate::tutorials). Further examples can be found in the
|
//! Further examples can be found in the [examples] directory.
|
||||||
//! [examples] directory.
|
|
||||||
//!
|
//!
|
||||||
//! [examples]: https://github.com/libp2p/rust-libp2p/tree/master/examples
|
//! [examples]: https://github.com/libp2p/rust-libp2p/tree/master/examples
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ use void::Void;
|
|||||||
/// If a connection is denied due to a limit, either a [`SwarmEvent::IncomingConnectionError`](libp2p_swarm::SwarmEvent::IncomingConnectionError)
|
/// 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.
|
/// 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
|
/// 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.
|
/// behaviour denied the connection.
|
||||||
///
|
///
|
||||||
/// If you employ multiple [`NetworkBehaviour`]s that manage connections, it may also be a different error.
|
/// If you employ multiple [`NetworkBehaviour`]s that manage connections, it may also be a different error.
|
||||||
|
@ -39,7 +39,7 @@ use std::{
|
|||||||
/// If a connection is denied due to a limit, either a [`SwarmEvent::IncomingConnectionError`](libp2p_swarm::SwarmEvent::IncomingConnectionError)
|
/// 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.
|
/// 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
|
/// 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.
|
/// behaviour denied the connection.
|
||||||
///
|
///
|
||||||
/// If you employ multiple [`NetworkBehaviour`]s that manage connections, it may also be a different error.
|
/// If you employ multiple [`NetworkBehaviour`]s that manage connections, it may also be a different error.
|
||||||
|
@ -40,13 +40,12 @@
|
|||||||
//! echoing the same protocol) or reject (by responding with a message stating
|
//! echoing the same protocol) or reject (by responding with a message stating
|
||||||
//! "not available"). If a suggested protocol is not available, the dialer may
|
//! "not available"). If a suggested protocol is not available, the dialer may
|
||||||
//! suggest another protocol. This process continues until a protocol is agreed upon,
|
//! 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.
|
//! alternatives.
|
||||||
//!
|
//!
|
||||||
//! See [`dialer_select_proto`](self::dialer_select_proto) and
|
//! See [`dialer_select_proto`] and [`listener_select_proto`].
|
||||||
//! [`listener_select_proto`](self::listener_select_proto).
|
|
||||||
//!
|
//!
|
||||||
//! ## [`Negotiated`](self::Negotiated)
|
//! ## [`Negotiated`]
|
||||||
//!
|
//!
|
||||||
//! A `Negotiated` represents an I/O stream that has settled on a protocol
|
//! A `Negotiated` represents an I/O stream that has settled on a protocol
|
||||||
//! to use. By default, with [`Version::V1`], protocol negotiation is always
|
//! 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
|
//! a variant [`Version::V1Lazy`] that permits 0-RTT negotiation if the
|
||||||
//! dialer only supports a single protocol. In that case, when a dialer
|
//! dialer only supports a single protocol. In that case, when a dialer
|
||||||
//! settles on a protocol to use, the [`DialerSelectFuture`] yields a
|
//! 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
|
//! 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
|
//! 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
|
//! 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
|
//! multiple 0-RTT negotiations in sequence for different protocols layered on
|
||||||
//! top of each other may trigger undesirable behaviour for a listener not
|
//! top of each other may trigger undesirable behaviour for a listener not
|
||||||
//! supporting one of the intermediate protocols. See
|
//! supporting one of the intermediate protocols. See
|
||||||
//! [`dialer_select_proto`](self::dialer_select_proto) and the documentation
|
//! [`dialer_select_proto`] and the documentation of [`Version::V1Lazy`] for further details.
|
||||||
//! of [`Version::V1Lazy`] for further details.
|
|
||||||
//!
|
//!
|
||||||
//! ## Examples
|
//! ## Examples
|
||||||
//!
|
//!
|
||||||
|
@ -144,7 +144,7 @@ pub trait NetworkBehaviour: 'static {
|
|||||||
/// This is invoked once another peer has successfully dialed us.
|
/// 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.
|
/// 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.
|
/// Returning an error will immediately close the connection.
|
||||||
fn handle_established_inbound_connection(
|
fn handle_established_inbound_connection(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -180,7 +180,7 @@ pub trait NetworkBehaviour: 'static {
|
|||||||
///
|
///
|
||||||
/// This is invoked once we have successfully dialed a peer.
|
/// 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.
|
/// 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.
|
/// Returning an error will immediately close the connection.
|
||||||
fn handle_established_outbound_connection(
|
fn handle_established_outbound_connection(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -193,7 +193,7 @@ pub trait NetworkBehaviour: 'static {
|
|||||||
/// Informs the behaviour about an event from the [`Swarm`](crate::Swarm).
|
/// Informs the behaviour about an event from the [`Swarm`](crate::Swarm).
|
||||||
fn on_swarm_event(&mut self, event: FromSwarm<Self::ConnectionHandler>);
|
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.
|
/// dedicated to the peer identified by `peer_id`. for the behaviour.
|
||||||
///
|
///
|
||||||
/// The [`PeerId`] is guaranteed to be in a connected state. In other words,
|
/// 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
|
/// Instructs the `Swarm` to send an event to the handler dedicated to a
|
||||||
/// connection with a peer.
|
/// connection with a peer.
|
||||||
///
|
///
|
||||||
/// If the `Swarm` is connected to the peer, the message is delivered to the
|
/// If the `Swarm` is connected to the peer, the message is delivered to the [`ConnectionHandler`]
|
||||||
/// [`ConnectionHandler`](crate::ConnectionHandler) instance identified by the peer ID and connection ID.
|
/// instance identified by the peer ID and connection ID.
|
||||||
///
|
///
|
||||||
/// If the specified connection no longer exists, the event is silently dropped.
|
/// 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
|
/// 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
|
/// [`NetworkBehaviour::on_connection_handler_event`], i.e. whenever the behaviour wishes to
|
||||||
/// respond to a request on the same connection (and possibly the same
|
/// 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
|
/// 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.
|
/// at any time and thus the event may not reach a handler.
|
||||||
NotifyHandler {
|
NotifyHandler {
|
||||||
/// The peer for whom a [`ConnectionHandler`](crate::ConnectionHandler) should be notified.
|
/// The peer for whom a [`ConnectionHandler`] should be notified.
|
||||||
peer_id: PeerId,
|
peer_id: PeerId,
|
||||||
/// The options w.r.t. which connection handler to notify of the event.
|
/// The options w.r.t. which connection handler to notify of the event.
|
||||||
handler: NotifyHandler,
|
handler: NotifyHandler,
|
||||||
@ -309,10 +309,10 @@ pub enum ToSwarm<TOutEvent, TInEvent> {
|
|||||||
///
|
///
|
||||||
/// Note: Closing a connection via
|
/// Note: Closing a connection via
|
||||||
/// [`ToSwarm::CloseConnection`] does not inform the
|
/// [`ToSwarm::CloseConnection`] does not inform the
|
||||||
/// corresponding [`ConnectionHandler`](crate::ConnectionHandler).
|
/// corresponding [`ConnectionHandler`].
|
||||||
/// Closing a connection via a [`ConnectionHandler`](crate::ConnectionHandler) can be done
|
/// Closing a connection via a [`ConnectionHandler`] can be done
|
||||||
/// either in a collaborative manner across [`ConnectionHandler`](crate::ConnectionHandler)s
|
/// either in a collaborative manner across [`ConnectionHandler`]s
|
||||||
/// with [`ConnectionHandler::connection_keep_alive`](crate::ConnectionHandler::connection_keep_alive) or directly with
|
/// with [`ConnectionHandler::connection_keep_alive`] or directly with
|
||||||
/// [`ConnectionHandlerEvent::Close`](crate::ConnectionHandlerEvent::Close).
|
/// [`ConnectionHandlerEvent::Close`](crate::ConnectionHandlerEvent::Close).
|
||||||
CloseConnection {
|
CloseConnection {
|
||||||
/// The peer to disconnect.
|
/// The peer to disconnect.
|
||||||
|
@ -144,8 +144,7 @@ where
|
|||||||
/// Note: This only enforces a limit on the number of concurrently
|
/// Note: This only enforces a limit on the number of concurrently
|
||||||
/// negotiating inbound streams. The total number of inbound streams on a
|
/// negotiating inbound streams. The total number of inbound streams on a
|
||||||
/// connection is the sum of negotiating and negotiated streams. A limit on
|
/// connection is the sum of negotiating and negotiated streams. A limit on
|
||||||
/// the total number of streams can be enforced at the
|
/// the total number of streams can be enforced at the [`StreamMuxerBox`] level.
|
||||||
/// [`StreamMuxerBox`](libp2p_core::muxing::StreamMuxerBox) level.
|
|
||||||
max_negotiating_inbound_streams: usize,
|
max_negotiating_inbound_streams: usize,
|
||||||
/// Contains all upgrades that are waiting for a new outbound substream.
|
/// Contains all upgrades that are waiting for a new outbound substream.
|
||||||
///
|
///
|
||||||
|
@ -981,7 +981,7 @@ impl PoolConfig {
|
|||||||
/// delivery to the connection handler.
|
/// delivery to the connection handler.
|
||||||
///
|
///
|
||||||
/// When the buffer for a particular connection is full, `notify_handler` will no
|
/// 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.
|
/// thus exerting back-pressure on the connection and peer API.
|
||||||
pub(crate) fn with_notify_handler_buffer_size(mut self, n: NonZeroUsize) -> Self {
|
pub(crate) fn with_notify_handler_buffer_size(mut self, n: NonZeroUsize) -> Self {
|
||||||
self.task_command_buffer_size = n.get() - 1;
|
self.task_command_buffer_size = n.get() - 1;
|
||||||
|
@ -159,8 +159,7 @@ use std::{
|
|||||||
|
|
||||||
/// Substream for which a protocol has been chosen.
|
/// Substream for which a protocol has been chosen.
|
||||||
///
|
///
|
||||||
/// Implements the [`AsyncRead`](futures::io::AsyncRead) and
|
/// Implements the [`AsyncRead`] and [`AsyncWrite`] traits.
|
||||||
/// [`AsyncWrite`](futures::io::AsyncWrite) traits.
|
|
||||||
#[deprecated(note = "The 'substream' terminology is deprecated. Use 'Stream' instead")]
|
#[deprecated(note = "The 'substream' terminology is deprecated. Use 'Stream' instead")]
|
||||||
pub type NegotiatedSubstream = Stream;
|
pub type NegotiatedSubstream = Stream;
|
||||||
|
|
||||||
@ -1515,8 +1514,7 @@ where
|
|||||||
/// Note: This only enforces a limit on the number of concurrently
|
/// Note: This only enforces a limit on the number of concurrently
|
||||||
/// negotiating inbound streams. The total number of inbound streams on a
|
/// negotiating inbound streams. The total number of inbound streams on a
|
||||||
/// connection is the sum of negotiating and negotiated streams. A limit on
|
/// connection is the sum of negotiating and negotiated streams. A limit on
|
||||||
/// the total number of streams can be enforced at the
|
/// the total number of streams can be enforced at the [`StreamMuxerBox`] level.
|
||||||
/// [`StreamMuxerBox`](libp2p_core::muxing::StreamMuxerBox) level.
|
|
||||||
pub fn max_negotiating_inbound_streams(mut self, v: usize) -> Self {
|
pub fn max_negotiating_inbound_streams(mut self, v: usize) -> Self {
|
||||||
self.pool_config = self.pool_config.with_max_negotiating_inbound_streams(v);
|
self.pool_config = self.pool_config.with_max_negotiating_inbound_streams(v);
|
||||||
self
|
self
|
||||||
|
Reference in New Issue
Block a user