Skip to content

Commit 256a656

Browse files
committed
Fix some broken links in rustdoc
1 parent f1f4095 commit 256a656

File tree

2 files changed

+44
-11
lines changed

2 files changed

+44
-11
lines changed

core/src/lib.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,26 @@
2323
//! The main concepts of libp2p-core are:
2424
//!
2525
//! - A [`PeerId`] is a unique global identifier for a node on the network.
26-
//! Each node must have a different `PeerId`. Normally, a `PeerId` is the
26+
//! Each node must have a different [`PeerId`]. Normally, a [`PeerId`] is the
2727
//! hash of the public key used to negotiate encryption on the
2828
//! communication channel, thereby guaranteeing that they cannot be spoofed.
2929
//! - The [`Transport`] trait defines how to reach a remote node or listen for
30-
//! incoming remote connections. See the `transport` module.
30+
//! incoming remote connections. See the [`transport`] module.
3131
//! - The [`StreamMuxer`] trait is implemented on structs that hold a connection
3232
//! to a remote and can subdivide this connection into multiple substreams.
33-
//! See the `muxing` module.
33+
//! See the [`muxing`] module.
3434
//! - The [`UpgradeInfo`], [`InboundUpgrade`] and [`OutboundUpgrade`] traits
3535
//! define how to upgrade each individual substream to use a protocol.
3636
//! See the `upgrade` module.
37+
//!
38+
//! [`PeerId`]: <struct.PeerId.html>
39+
//! [`UpgradeInfo`]: <upgrade/trait.UpgradeInfo.html>
40+
//! [`InboundUpgrade`]: <upgrade/trait.InboundUpgrade.html>
41+
//! [`OutboundUpgrade`]: <upgrade/trait.OutboundUpgrade.html>
42+
//! [`Transport`]: <transport/trait.Transport.html>
43+
//! [`transport`]: <transport/index.html>
44+
//! [`StreamMuxer`]: <muxing/trait.StreamMuxer.html>
45+
//! [`muxing`]: <muxing/index.html>
3746
3847
mod keys_proto {
3948
include!(concat!(env!("OUT_DIR"), "/keys_proto.rs"));

core/src/transport/upgrade.rs

+32-8
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,26 @@ use std::{error::Error, fmt, pin::Pin, task::Context, task::Poll};
5353
///
5454
/// The upgrade process is defined by the following stages:
5555
///
56-
/// [`authenticate`](Builder::authenticate)`{1}`
57-
/// -> [`apply`](Builder::apply)`{*}`
58-
/// -> [`multiplex`](Builder::multiplex)`{1}`
56+
/// [`authenticate`](struct.Builder.html#method.authenticate)`{1}`
57+
/// -> [`apply`](struct.Builder.html#method.apply)`{*}`
58+
/// -> [`multiplex`](struct.Builder.html#method.multiplex)`{1}`
5959
///
6060
/// It thus enforces the following invariants on every transport
61-
/// obtained from [`multiplex`](Builder::multiplex):
61+
/// obtained from [`multiplex`](struct.Builder.html#method.multiplex)
6262
///
63-
/// 1. The transport must be [authenticated](Builder::authenticate)
64-
/// and [multiplexed](Builder::multiplex).
63+
/// 1. The transport must be [authenticated](struct.Builder.html#method.authenticate)
64+
/// and [multiplexed](struct.Builder.html#method.multiplex).
6565
/// 2. Authentication must precede the negotiation of a multiplexer.
6666
/// 3. Applying a multiplexer is the last step in the upgrade process.
6767
/// 4. The [`Transport::Output`] conforms to the requirements of a [`Network`],
6868
/// namely a tuple of a [`ConnectionInfo`] (from the authentication upgrade) and a
6969
/// [`StreamMuxer`] (from the multiplexing upgrade).
7070
///
71-
/// [`Network`]: crate::nodes::Network
71+
/// [`ConnectionInfo`]: <../../nodes/collection/trait.ConnectionInfo.html>
72+
/// [`Network`]: <../../nodes/network/struct.Network.html>
73+
/// [`Transport`]: <../../transport/trait.Transport.html>
74+
/// [`Transport::Output`]: <../../transport/trait.Transport.html#associatedType.Output>
75+
/// [`StreamMuxer`]: <../../muxing/trait.StreamMuxing.html>
7276
pub struct Builder<T> {
7377
inner: T,
7478
version: upgrade::Version,
@@ -97,6 +101,8 @@ where
97101
///
98102
/// * I/O upgrade: `C -> (I, D)`.
99103
/// * Transport output: `C -> (I, D)`
104+
///
105+
/// [`ConnectionInfo`]: <../../nodes/collection/trait.ConnectionInfo.html>
100106
pub fn authenticate<C, D, U, I, E>(self, upgrade: U) -> Builder<
101107
AndThen<T, impl FnOnce(C, ConnectedPoint) -> Authenticate<C, U> + Clone>
102108
> where
@@ -151,6 +157,8 @@ where
151157
///
152158
/// * I/O upgrade: `C -> M`.
153159
/// * Transport output: `(I, C) -> (I, M)`.
160+
///
161+
/// [`StreamMuxer`]: <../../muxing/trait.StreamMuxing.html>
154162
pub fn multiplex<C, M, U, I, E>(self, upgrade: U)
155163
-> AndThen<T, impl FnOnce((I, C), ConnectedPoint) -> Multiplex<C, U, I> + Clone>
156164
where
@@ -174,6 +182,8 @@ where
174182
/// in the context of negotiating a secure channel.
175183
///
176184
/// Configured through [`Builder::authenticate`].
185+
///
186+
/// [`Builder::authenticate`]: <../struct.Builder.html#method.authenticate>
177187
#[pin_project::pin_project]
178188
pub struct Authenticate<C, U>
179189
where
@@ -204,6 +214,8 @@ where
204214
/// top of an authenticated transport.
205215
///
206216
/// Configured through [`Builder::multiplex`].
217+
///
218+
/// [`Builder::multiplex`]: <../struct.Builder.html#method.multiplex>
207219
#[pin_project::pin_project]
208220
pub struct Multiplex<C, U, I>
209221
where
@@ -239,7 +251,10 @@ type EitherUpgrade<C, U> = future::Either<InboundUpgradeApply<C, U>, OutboundUpg
239251

240252
/// An upgrade on an authenticated, non-multiplexed [`Transport`].
241253
///
242-
/// See [`Builder::upgrade`](Builder::upgrade).
254+
/// See [`Builder`](../struct.Builder.html)
255+
///
256+
/// [`Transport`]: <../../transport/trait.Transport.html>
257+
///
243258
#[derive(Debug, Copy, Clone)]
244259
pub struct Upgrade<T, U> { inner: T, upgrade: U }
245260

@@ -319,6 +334,9 @@ where
319334
}
320335

321336
/// The [`Transport::Dial`] future of an [`Upgrade`]d transport.
337+
///
338+
/// [`Transport::Dial`]: <../../transport/trait.Transport.html#associatedType.Dial>
339+
/// [`Upgrade`]: <../struct.Upgrade.html>
322340
pub struct DialUpgradeFuture<F, U, I, C>
323341
where
324342
U: OutboundUpgrade<Negotiated<C>>,
@@ -373,6 +391,9 @@ where
373391
}
374392

375393
/// The [`Transport::Listener`] stream of an [`Upgrade`]d transport.
394+
///
395+
/// [`Transport::Listener`]: <../../transport/trait.Transport.html#associatedType.Listener>
396+
/// [`Upgrade`]: <../struct.Upgrade.html>
376397
pub struct ListenerStream<S, U> {
377398
stream: Pin<Box<S>>,
378399
upgrade: U
@@ -410,6 +431,9 @@ impl<S, U> Unpin for ListenerStream<S, U> {
410431
}
411432

412433
/// The [`Transport::ListenerUpgrade`] future of an [`Upgrade`]d transport.
434+
///
435+
/// [`Transport::ListenerUpgrade`]: <../../transport/trait.Transport.html#associatedType.ListenerUpgrade>
436+
/// [`Upgrade`]: <../struct.Upgrade.html>
413437
pub struct ListenerUpgradeFuture<F, U, I, C>
414438
where
415439
C: AsyncRead + AsyncWrite + Unpin,

0 commit comments

Comments
 (0)