Skip to content

Fix some broken links in rustdoc #1411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/identity/rsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl PublicKey {
/// Encode the RSA public key in DER as a X.509 SubjectPublicKeyInfo structure,
/// as defined in [RFC5280].
///
/// [RFC5280] https://tools.ietf.org/html/rfc5280#section-4.1
/// [RFC5280]: https://tools.ietf.org/html/rfc5280#section-4.1
pub fn encode_x509(&self) -> Vec<u8> {
let spki = Asn1SubjectPublicKeyInfo {
algorithmIdentifier: Asn1RsaEncryption {
Expand Down
2 changes: 1 addition & 1 deletion core/src/nodes/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//!
//! The core type is a [`task::Task`], which implements [`futures::Future`]
//! and connects and handles a node. A task receives and sends messages
//! ([`tasks::FromTaskMessage`], [`tasks::ToTaskMessage`]) to the outside.
//! ([`task::FromTaskMessage`], [`task::ToTaskMessage`]) to the outside.
//!
//! A set of tasks is managed by a [`Manager`] which creates tasks when a
//! node should be connected to (cf. [`Manager::add_reach_attempt`]) or
Expand Down
2 changes: 1 addition & 1 deletion core/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pub trait Transport {
}

/// Begins a series of protocol upgrades via an
/// [`upgrade::Builder`](core::transport::upgrade::Builder).
/// [`upgrade::Builder`](upgrade::Builder).
fn upgrade(self, version: upgrade::Version) -> upgrade::Builder<Self>
where
Self: Sized,
Expand Down
2 changes: 1 addition & 1 deletion core/src/transport/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ type EitherUpgrade<C, U> = future::Either<InboundUpgradeApply<C, U>, OutboundUpg

/// An upgrade on an authenticated, non-multiplexed [`Transport`].
///
/// See [`Builder::upgrade`](Builder::upgrade).
/// See [`Transport::upgrade`]
#[derive(Debug, Copy, Clone)]
pub struct Upgrade<T, U> { inner: T, upgrade: U }

Expand Down
2 changes: 1 addition & 1 deletion misc/multiaddr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl Multiaddr {
Some(protocol)
}

/// Like [`push`] but consumes `self`.
/// Like [`Multiaddr::push`] but consumes `self`.
pub fn with(mut self, p: Protocol<'_>) -> Self {
let mut w = io::Cursor::<&mut Vec<u8>>::new(Arc::make_mut(&mut self.bytes));
w.set_position(w.get_ref().len() as u64);
Expand Down
4 changes: 2 additions & 2 deletions misc/multistream-select/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ const MSG_LS: &[u8] = b"ls\n";
pub enum Version {
/// Version 1 of the multistream-select protocol. See [1] and [2].
///
/// [1] https://github.com/libp2p/specs/blob/master/connections/README.md#protocol-negotiation
/// [2] https://github.com/multiformats/multistream-select
/// [1]: https://github.com/libp2p/specs/blob/master/connections/README.md#protocol-negotiation
/// [2]: https://github.com/multiformats/multistream-select
V1,
/// A lazy variant of version 1 that is identical on the wire but delays
/// sending of protocol negotiation data as much as possible.
Expand Down
2 changes: 1 addition & 1 deletion misc/rw-stream-sink/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! [`AsyncRead`] and [`AsyncWrite`].
//!
//! Each call to [`AsyncWrite::poll_write`] will send one packet to the sink.
//! Calls to [`AsyncRead::read`] will read from the stream's incoming packets.
//! Calls to [`AsyncRead::poll_read`] will read from the stream's incoming packets.

use futures::{prelude::*, ready};
use std::{io::{self, Read}, pin::Pin, task::{Context, Poll}};
Expand Down
8 changes: 4 additions & 4 deletions muxers/yamux/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<S> fmt::Debug for Yamux<S> {
}

struct Inner<S> {
/// The `futures::stream::Stream` of incoming substreams.
/// The [`futures::stream::Stream`] of incoming substreams.
incoming: S,
/// Handle to control the connection.
control: yamux::Control,
Expand Down Expand Up @@ -171,7 +171,7 @@ impl Config {
Config(cfg)
}

/// Turn this into a `LocalConfig` for use with upgrades of !Send resources.
/// Turn this into a [`LocalConfig`] for use with upgrades of ![`Send`] resources.
pub fn local(self) -> LocalConfig {
LocalConfig(self)
}
Expand Down Expand Up @@ -253,7 +253,7 @@ where
}
}

/// The Yamux [`StreamMuxer`] error type.
/// The Yamux [`libp2p_core::StreamMuxer`] error type.
#[derive(Debug, Error)]
#[error("yamux error: {0}")]
pub struct YamuxError(#[from] pub yamux::ConnectionError);
Expand Down Expand Up @@ -316,4 +316,4 @@ impl<T> Stream for LocalIncoming<T> {
}

impl<T> Unpin for LocalIncoming<T> {
}
}
4 changes: 2 additions & 2 deletions protocols/kad/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ where
/// of the libp2p Kademlia provider API.
///
/// The results of the (repeated) provider announcements sent by this node are
/// delivered in [`KademliaEvent::AddProviderResult`].
/// delivered in [`AddProviderResult`].
pub fn start_providing(&mut self, key: record::Key) {
let record = ProviderRecord::new(key.clone(), self.kbuckets.local_key().preimage().clone());
if let Err(err) = self.store.add_provider(record) {
Expand Down Expand Up @@ -1440,7 +1440,7 @@ impl Quorum {

/// The events produced by the `Kademlia` behaviour.
///
/// See [`Kademlia::poll`].
/// See [`NetworkBehaviour::poll`].
#[derive(Debug)]
pub enum KademliaEvent {
/// The result of [`Kademlia::bootstrap`].
Expand Down
4 changes: 2 additions & 2 deletions protocols/kad/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
//!
//! This module implements two periodic jobs:
//!
//! * [`jobs::PutRecordJob`]: For (re-)publication and (re-)replication of
//! * [`PutRecordJob`]: For (re-)publication and (re-)replication of
//! regular (value-)records.
//!
//! * [`jobs::AddProviderJob`]: For (re-)publication of provider records.
//! * [`AddProviderJob`]: For (re-)publication of provider records.
//! Provider records currently have no separate replication mechanism.
//!
//! A periodic job is driven like a `Future` or `Stream` by `poll`ing it.
Expand Down
13 changes: 6 additions & 7 deletions protocols/kad/src/kbucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
//! an [`AppliedPending`] result which must be consumed by calling [`take_applied_pending`]
//! regularly and / or after performing lookup operations like [`entry`] and [`closest`].
//!
//! [`entry`]: kbucket::KBucketsTable::entry
//! [`closest`]: kbucket::KBucketsTable::closest
//! [`AppliedPending`]: kbucket::AppliedPending
//! [`KBucketsTable`]: kbucket::KBucketsTable
//! [`take_applied_pending`]: kbucket::KBucketsTable::take_applied_pending
//! [`PendingEntry`]: kbucket::PendingEntry
//! [`entry`]: KBucketsTable::entry
//! [`closest`]: KBucketsTable::closest
//! [`AppliedPending`]: bucket::AppliedPending
//! [`take_applied_pending`]: KBucketsTable::take_applied_pending
//! [`PendingEntry`]: entry::PendingEntry

// [Implementation Notes]
//
Expand Down Expand Up @@ -469,7 +468,7 @@ where
/// Together with a known key `a` (e.g. the local key), a random distance `d` for
/// this bucket w.r.t `k` gives rise to the corresponding (random) key `b` s.t.
/// the XOR distance between `a` and `b` is `d`. In other words, it gives
/// rise to a random key falling into this bucket. See [`Key::from_distance`].
/// rise to a random key falling into this bucket. See [`key::Key::for_distance`].
pub fn rand_distance(&self, rng: &mut impl rand::Rng) -> Distance {
self.index.rand_distance(rng)
}
Expand Down
4 changes: 0 additions & 4 deletions protocols/kad/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
//! The upgrade's output is a `Sink + Stream` of messages. The `Stream` component is used
//! to poll the underlying transport for incoming messages, and the `Sink` component
//! is used to send messages to remote peers.
//!
//! [`KademliaProtocolConfig`]: protocol::KademliaProtocolConfig
//! [`KadRequestMsg`]: protocol::KadRequestMsg
//! [`KadResponseMsg`]: protocol::KadResponseMsg

use bytes::BytesMut;
use codec::UviBytes;
Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/src/query/peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
//!
//! A peer iterator can be finished prematurely at any time through `finish`.
//!
//! [`Finished`]: peers::PeersIterState::Finished
//! [`Finished`]: PeersIterState::Finished

pub mod closest;
pub mod fixed;
Expand Down
2 changes: 1 addition & 1 deletion protocols/noise/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ where
///
/// On success, the upgrade yields the [`PeerId`] obtained from the
/// `RemoteIdentity`. The output of this upgrade is thus directly suitable
/// for creating an [`authenticated`](libp2p_core::TransportBuilder::authenticate)
/// for creating an [`authenticated`](libp2p_core::transport::upgrade::Authenticate)
/// transport for use with a [`Network`](libp2p_core::nodes::Network).
#[derive(Clone)]
pub struct NoiseAuthenticated<P, C: Zeroize, R> {
Expand Down
4 changes: 2 additions & 2 deletions protocols/ping/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ impl PingConfig {
/// at any time, i.e. in the absence of ping failures the connection lifetime
/// is determined by other protocol handlers.
///
/// If the maximum number of allowed ping failures is reached, the
/// connection is always terminated as a result of [`PingHandler::poll`]
/// If the maximum number of allowed ping failures is reached, the
/// connection is always terminated as a result of [`ProtocolsHandler::poll`]
/// returning an error, regardless of the keep-alive setting.
pub fn with_keep_alive(mut self, b: bool) -> Self {
self.keep_alive = b;
Expand Down
2 changes: 1 addition & 1 deletion protocols/ping/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
//! > it only adds an additional condition for terminating the connection, namely
//! > a certain number of failed ping requests.
//!
//! [`Swarm`]: libp2p_core::Swarm
//! [`Swarm`]: libp2p_swarm::Swarm
//! [`Transport`]: libp2p_core::Transport

pub mod protocol;
Expand Down
2 changes: 1 addition & 1 deletion protocols/secio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//!
//! The `SecioConfig` implements [`InboundUpgrade`] and [`OutboundUpgrade`] and thus
//! serves as a connection upgrade for authentication of a transport.
//! See [`authenticate`](libp2p_core::transport::upgrade::builder::Builder::authenticate).
//! See [`authenticate`](libp2p_core::transport::upgrade::Builder::authenticate).
//!
//! ```no_run
//! # fn main() {
Expand Down
8 changes: 5 additions & 3 deletions swarm/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ pub trait NetworkBehaviour {

/// Parameters passed to `poll()`, that the `NetworkBehaviour` has access to.
pub trait PollParameters {
/// Iterator returned by [`supported_protocols`].
/// Iterator returned by [`supported_protocols`](PollParameters::supported_protocols).
type SupportedProtocolsIter: ExactSizeIterator<Item = Vec<u8>>;
/// Iterator returned by [`listened_addresses`].
/// Iterator returned by [`listened_addresses`](PollParameters::listened_addresses).
type ListenedAddressesIter: ExactSizeIterator<Item = Multiaddr>;
/// Iterator returned by [`external_addresses`].
/// Iterator returned by [`external_addresses`](PollParameters::external_addresses).
type ExternalAddressesIter: ExactSizeIterator<Item = Multiaddr>;

/// Returns the list of protocol the behaviour supports when a remote negotiates a protocol on
Expand Down Expand Up @@ -190,6 +190,8 @@ pub trait NetworkBehaviourEventProcess<TEvent> {

/// An action that a [`NetworkBehaviour`] can trigger in the [`Swarm`]
/// in whose context it is executing.
///
/// [`Swarm`]: super::Swarm
#[derive(Debug, Clone)]
pub enum NetworkBehaviourAction<TInEvent, TOutEvent> {
/// Instructs the `Swarm` to return an event when it is being polled.
Expand Down
6 changes: 3 additions & 3 deletions swarm/src/protocols_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ pub use select::{IntoProtocolsHandlerSelect, ProtocolsHandlerSelect};
/// Communication with a remote over a set of protocols is initiated in one of two ways:
///
/// 1. Dialing by initiating a new outbound substream. In order to do so,
/// [`ProtocolsHandler::poll()`] must return an [`OutboundSubstreamRequest`], providing an
/// instance of [`ProtocolsHandler::OutboundUpgrade`] that is used to negotiate the
/// [`ProtocolsHandler::poll()`] must return an [`ProtocolsHandlerEvent::OutboundSubstreamRequest`],
/// providing an instance of [`libp2p_core::upgrade::OutboundUpgrade`] that is used to negotiate the
/// protocol(s). Upon success, [`ProtocolsHandler::inject_fully_negotiated_outbound`]
/// is called with the final output of the upgrade.
///
/// 2. Listening by accepting a new inbound substream. When a new inbound substream
/// is created on a connection, [`ProtocolsHandler::listen_protocol`] is called
/// to obtain an instance of [`ProtocolsHandler::InboundUpgrade`] that is used to
/// to obtain an instance of [`libp2p_core::upgrade::InboundUpgrade`] that is used to
/// negotiate the protocol(s). Upon success,
/// [`ProtocolsHandler::inject_fully_negotiated_inbound`] is called with the final
/// output of the upgrade.
Expand Down