Skip to content

Commit c7f8521

Browse files
committed
Drop all HTML-relative links since rustdoc now supports resolution
1 parent 88a10a1 commit c7f8521

File tree

7 files changed

+38
-100
lines changed

7 files changed

+38
-100
lines changed

background-processor/src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ impl BackgroundProcessor {
5353
/// [`thread_handle`]'s `join()` method to be able to tell if and when an error is returned, or
5454
/// implement `persist_manager` such that an error is never returned to the `BackgroundProcessor`
5555
///
56-
/// `persist_manager` is responsible for writing out the `ChannelManager` to disk, and/or uploading
57-
/// to one or more backup services. See [`ChannelManager::write`] for writing out a `ChannelManager`.
56+
/// `persist_manager` is responsible for writing out the [`ChannelManager`] to disk, and/or uploading
57+
/// to one or more backup services. See [`ChannelManager::write`] for writing out a [`ChannelManager`].
5858
/// See [`FilesystemPersister::persist_manager`] for Rust-Lightning's provided implementation.
5959
///
60-
/// [`thread_handle`]: struct.BackgroundProcessor.html#structfield.thread_handle
61-
/// [`ChannelManager::write`]: ../lightning/ln/channelmanager/struct.ChannelManager.html#method.write
62-
/// [`FilesystemPersister::persist_manager`]: ../lightning_persister/struct.FilesystemPersister.html#impl
60+
/// [`thread_handle`]: `BackgroundProcessor::thread_handle`
61+
/// [`ChannelManager`]: `lightning::ln::channelmanager::ChannelManager`
62+
/// [`ChannelManager::write`]: `lightning::ln::channelmanager::ChannelManager#impl-Writeable`
63+
/// [`FilesystemPersister::persist_manager`]: `lightning_persister::FilesystemPersister::persist_manager`
6364
pub fn start<PM, Signer, M, T, K, F, L>(persist_manager: PM, manager: Arc<ChannelManager<Signer, Arc<M>, Arc<T>, Arc<K>, Arc<F>, Arc<L>>>, logger: Arc<L>) -> Self
6465
where Signer: 'static + Sign,
6566
M: 'static + chain::Watch<Signer>,

lightning-block-sync/src/lib.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
//!
1313
//! Both features support either blocking I/O using `std::net::TcpStream` or, with feature `tokio`,
1414
//! non-blocking I/O using `tokio::net::TcpStream` from inside a Tokio runtime.
15-
//!
16-
//! [`SpvClient`]: struct.SpvClient.html
17-
//! [`BlockSource`]: trait.BlockSource.html
1815
1916
#![deny(broken_intra_doc_links)]
2017
#![deny(missing_docs)]
@@ -73,8 +70,7 @@ pub trait BlockSource : Sync + Send {
7370
/// When polling a block source, [`Poll`] implementations may pass the height to [`get_header`]
7471
/// to allow for a more efficient lookup.
7572
///
76-
/// [`Poll`]: poll/trait.Poll.html
77-
/// [`get_header`]: #tymethod.get_header
73+
/// [`get_header`]: `Self::get_header`
7874
fn get_best_block<'a>(&'a mut self) -> AsyncBlockSourceResult<(BlockHash, Option<u32>)>;
7975
}
8076

@@ -180,8 +176,6 @@ where L::Target: chain::Listen {
180176
/// Implementations may define how long to retain headers such that it's unlikely they will ever be
181177
/// needed to disconnect a block. In cases where block sources provide access to headers on stale
182178
/// forks reliably, caches may be entirely unnecessary.
183-
///
184-
/// [`ChainNotifier`]: struct.ChainNotifier.html
185179
pub trait Cache {
186180
/// Retrieves the block header keyed by the given block hash.
187181
fn look_up(&self, block_hash: &BlockHash) -> Option<&ValidatedBlockHeader>;
@@ -222,7 +216,7 @@ impl<'a, P: Poll, C: Cache, L: Deref> SpvClient<'a, P, C, L> where L::Target: ch
222216
/// * `header_cache` is used to look up and store headers on the best chain
223217
/// * `chain_listener` is notified of any blocks connected or disconnected
224218
///
225-
/// [`poll_best_tip`]: struct.SpvClient.html#method.poll_best_tip
219+
/// [`poll_best_tip`]: `SpvClient::poll_best_tip`
226220
pub fn new(
227221
chain_tip: ValidatedBlockHeader,
228222
chain_poller: P,
@@ -277,7 +271,7 @@ impl<'a, P: Poll, C: Cache, L: Deref> SpvClient<'a, P, C, L> where L::Target: ch
277271

278272
/// Notifies [listeners] of blocks that have been connected or disconnected from the chain.
279273
///
280-
/// [listeners]: ../../lightning/chain/trait.Listen.html
274+
/// [listeners]: `lightning::chain::Listen`
281275
pub struct ChainNotifier<'a, C: Cache, L: Deref> where L::Target: chain::Listen {
282276
/// Cache for looking up headers before fetching from a block source.
283277
header_cache: &'a mut C,

lightning/src/chain/chainmonitor.rs

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,15 @@
1313
//! update [`ChannelMonitor`]s accordingly. If any on-chain events need further processing, it will
1414
//! make those available as [`MonitorEvent`]s to be consumed.
1515
//!
16-
//! `ChainMonitor` is parameterized by an optional chain source, which must implement the
16+
//! [`ChainMonitor`] is parameterized by an optional chain source, which must implement the
1717
//! [`chain::Filter`] trait. This provides a mechanism to signal new relevant outputs back to light
1818
//! clients, such that transactions spending those outputs are included in block data.
1919
//!
20-
//! `ChainMonitor` may be used directly to monitor channels locally or as a part of a distributed
21-
//! setup to monitor channels remotely. In the latter case, a custom `chain::Watch` implementation
20+
//! [`ChainMonitor`] may be used directly to monitor channels locally or as a part of a distributed
21+
//! setup to monitor channels remotely. In the latter case, a custom [`chain::Watch`] implementation
2222
//! would be responsible for routing each update to a remote server and for retrieving monitor
23-
//! events. The remote server would make use of `ChainMonitor` for block processing and for
24-
//! servicing `ChannelMonitor` updates from the client.
25-
//!
26-
//! [`ChainMonitor`]: struct.ChainMonitor.html
27-
//! [`chain::Filter`]: ../trait.Filter.html
28-
//! [`chain::Watch`]: ../trait.Watch.html
29-
//! [`ChannelMonitor`]: ../channelmonitor/struct.ChannelMonitor.html
30-
//! [`MonitorEvent`]: ../channelmonitor/enum.MonitorEvent.html
23+
//! events. The remote server would make use of [`ChainMonitor`] for block processing and for
24+
//! servicing [`ChannelMonitor`] updates from the client.
3125
3226
use bitcoin::blockdata::block::{Block, BlockHeader};
3327

@@ -53,9 +47,8 @@ use std::ops::Deref;
5347
/// or used independently to monitor channels remotely. See the [module-level documentation] for
5448
/// details.
5549
///
56-
/// [`chain::Watch`]: ../trait.Watch.html
57-
/// [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
58-
/// [module-level documentation]: index.html
50+
/// [`ChannelManager`]: `crate::ln::channelmanager::ChannelManager`
51+
/// [module-level documentation]: `crate::chain::chainmonitor`
5952
pub struct ChainMonitor<ChannelSigner: Sign, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref>
6053
where C::Target: chain::Filter,
6154
T::Target: BroadcasterInterface,
@@ -88,10 +81,6 @@ where C::Target: chain::Filter,
8881
/// calls must not exclude any transactions matching the new outputs nor any in-block
8982
/// descendants of such transactions. It is not necessary to re-fetch the block to obtain
9083
/// updated `txdata`.
91-
///
92-
/// [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
93-
/// [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
94-
/// [`chain::Filter`]: ../trait.Filter.html
9584
pub fn block_connected(&self, header: &BlockHeader, txdata: &TransactionData, height: u32) {
9685
let monitors = self.monitors.read().unwrap();
9786
for monitor in monitors.values() {
@@ -110,8 +99,6 @@ where C::Target: chain::Filter,
11099
/// Dispatches to per-channel monitors, which are responsible for updating their on-chain view
111100
/// of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
112101
/// details.
113-
///
114-
/// [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
115102
pub fn block_disconnected(&self, header: &BlockHeader, disconnected_height: u32) {
116103
let monitors = self.monitors.read().unwrap();
117104
for monitor in monitors.values() {
@@ -126,8 +113,6 @@ where C::Target: chain::Filter,
126113
/// pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
127114
/// always need to fetch full blocks absent another means for determining which blocks contain
128115
/// transactions relevant to the watched channels.
129-
///
130-
/// [`chain::Filter`]: ../trait.Filter.html
131116
pub fn new(chain_source: Option<C>, broadcaster: T, logger: L, feeest: F, persister: P) -> Self {
132117
Self {
133118
monitors: RwLock::new(HashMap::new()),
@@ -174,8 +159,6 @@ where C::Target: chain::Filter,
174159
///
175160
/// Note that we persist the given `ChannelMonitor` while holding the `ChainMonitor`
176161
/// monitors lock.
177-
///
178-
/// [`chain::Filter`]: ../trait.Filter.html
179162
fn watch_channel(&self, funding_outpoint: OutPoint, monitor: ChannelMonitor<ChannelSigner>) -> Result<(), ChannelMonitorUpdateErr> {
180163
let mut monitors = self.monitors.write().unwrap();
181164
let entry = match monitors.entry(funding_outpoint) {

lightning/src/chain/channelmonitor.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
//! ChannelMonitors should do so). Thus, if you're building rust-lightning into an HSM or other
2020
//! security-domain-separated system design, you should consider having multiple paths for
2121
//! ChannelMonitors to get out of the HSM and onto monitoring devices.
22-
//!
23-
//! [`chain::Watch`]: ../trait.Watch.html
2422
2523
use bitcoin::blockdata::block::{Block, BlockHeader};
2624
use bitcoin::blockdata::transaction::{TxOut,Transaction};
@@ -75,8 +73,6 @@ pub struct ChannelMonitorUpdate {
7573
/// The only instance where update_id values are not strictly increasing is the case where we
7674
/// allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
7775
/// its docs for more details.
78-
///
79-
/// [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
8076
pub update_id: u64,
8177
}
8278

@@ -193,8 +189,6 @@ pub enum MonitorEvent {
193189
/// Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
194190
/// chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
195191
/// preimage claim backward will lead to loss of funds.
196-
///
197-
/// [`chain::Watch`]: ../trait.Watch.html
198192
#[derive(Clone, PartialEq)]
199193
pub struct HTLCUpdate {
200194
pub(crate) payment_hash: PaymentHash,
@@ -1187,8 +1181,6 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
11871181

11881182
/// Get the list of HTLCs who's status has been updated on chain. This should be called by
11891183
/// ChannelManager via [`chain::Watch::release_pending_monitor_events`].
1190-
///
1191-
/// [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
11921184
pub fn get_and_clear_pending_monitor_events(&self) -> Vec<MonitorEvent> {
11931185
self.inner.lock().unwrap().get_and_clear_pending_monitor_events()
11941186
}
@@ -2450,11 +2442,8 @@ pub trait Persist<ChannelSigner: Sign>: Send + Sync {
24502442
/// stored channel data). Note that you **must** persist every new monitor to
24512443
/// disk. See the `Persist` trait documentation for more details.
24522444
///
2453-
/// See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
2445+
/// See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
24542446
/// and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
2455-
///
2456-
/// [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
2457-
/// [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
24582447
fn persist_new_channel(&self, id: OutPoint, data: &ChannelMonitor<ChannelSigner>) -> Result<(), ChannelMonitorUpdateErr>;
24592448

24602449
/// Update one channel's data. The provided `ChannelMonitor` has already
@@ -2476,14 +2465,9 @@ pub trait Persist<ChannelSigner: Sign>: Send + Sync {
24762465
/// them in batches. The size of each monitor grows `O(number of state updates)`
24772466
/// whereas updates are small and `O(1)`.
24782467
///
2479-
/// See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
2468+
/// See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
24802469
/// [`ChannelMonitorUpdate::write`] for writing out an update, and
24812470
/// [`ChannelMonitorUpdateErr`] for requirements when returning errors.
2482-
///
2483-
/// [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1
2484-
/// [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
2485-
/// [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write
2486-
/// [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
24872471
fn update_persisted_channel(&self, id: OutPoint, update: &ChannelMonitorUpdate, data: &ChannelMonitor<ChannelSigner>) -> Result<(), ChannelMonitorUpdateErr>;
24882472
}
24892473

lightning/src/chain/mod.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ pub mod transaction;
2525
pub mod keysinterface;
2626

2727
/// An error when accessing the chain via [`Access`].
28-
///
29-
/// [`Access`]: trait.Access.html
3028
#[derive(Clone)]
3129
pub enum AccessError {
3230
/// The requested chain is unknown.
@@ -77,28 +75,28 @@ pub trait Listen {
7775
/// funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7876
/// multiple instances.
7977
///
80-
/// [`ChannelMonitor`]: channelmonitor/struct.ChannelMonitor.html
81-
/// [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
82-
/// [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure
78+
/// [`ChannelMonitor`]: `channelmonitor::ChannelMonitor`
79+
/// [`ChannelMonitorUpdateErr`]: `channelmonitor::ChannelMonitorUpdateErr`
80+
/// [`PermanentFailure`]: `channelmonitor::ChannelMonitorUpdateErr::PermanentFailure`
8381
pub trait Watch<ChannelSigner: Sign>: Send + Sync {
8482
/// Watches a channel identified by `funding_txo` using `monitor`.
8583
///
8684
/// Implementations are responsible for watching the chain for the funding transaction along
8785
/// with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
8886
/// calling [`block_connected`] and [`block_disconnected`] on the monitor.
8987
///
90-
/// [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch
91-
/// [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected
92-
/// [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
88+
/// [`get_outputs_to_watch`]: `channelmonitor::ChannelMonitor::get_outputs_to_watch
89+
/// [`block_connected`]: `channelmonitor::ChannelMonitor::block_connected`
90+
/// [`block_disconnected`]: `channelmonitor::ChannelMonitor::block_disconnected`
9391
fn watch_channel(&self, funding_txo: OutPoint, monitor: ChannelMonitor<ChannelSigner>) -> Result<(), ChannelMonitorUpdateErr>;
9492

9593
/// Updates a channel identified by `funding_txo` by applying `update` to its monitor.
9694
///
9795
/// Implementations must call [`update_monitor`] with the given update. See
9896
/// [`ChannelMonitorUpdateErr`] for invariants around returning an error.
9997
///
100-
/// [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor
101-
/// [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
98+
/// [`update_monitor`]: `channelmonitor::ChannelMonitor::update_monitor`
99+
/// [`ChannelMonitorUpdateErr`]: `channelmonitor::ChannelMonitorUpdateErr
102100
fn update_channel(&self, funding_txo: OutPoint, update: ChannelMonitorUpdate) -> Result<(), ChannelMonitorUpdateErr>;
103101

104102
/// Returns any monitor events since the last call. Subsequent calls must only return new
@@ -120,11 +118,10 @@ pub trait Watch<ChannelSigner: Sign>: Send + Sync {
120118
///
121119
/// Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
122120
/// should not block on I/O. Implementations should instead queue the newly monitored data to be
123-
/// processed later. Then, in order to block until the data has been processed, any `Watch`
121+
/// processed later. Then, in order to block until the data has been processed, any [`Watch`]
124122
/// invocation that has called the `Filter` must return [`TemporaryFailure`].
125123
///
126-
/// [`Watch`]: trait.Watch.html
127-
/// [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure
124+
/// [`TemporaryFailure`]: `channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure`
128125
/// [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
129126
/// [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
130127
pub trait Filter: Send + Sync {

lightning/src/ln/features.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@
1212
//! Lightning nodes advertise a supported set of operation through feature flags. Features are
1313
//! applicable for a specific context as indicated in some [messages]. [`Features`] encapsulates
1414
//! behavior for specifying and checking feature flags for a particular context. Each feature is
15-
//! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits). A
16-
//! [`Context`] is used to parameterize [`Features`] and defines which features it can support.
15+
//! defined internally by a trait specifying the corresponding flags (i.e., even and odd bits).
1716
//!
1817
//! Whether a feature is considered "known" or "unknown" is relative to the implementation, whereas
1918
//! the term "supports" is used in reference to a particular set of [`Features`]. That is, a node
2019
//! supports a feature if it advertises the feature (as either required or optional) to its peers.
2120
//! And the implementation can interpret a feature if the feature is known to it.
2221
//!
2322
//! [BOLT #9]: https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md
24-
//! [messages]: ../msgs/index.html
25-
//! [`Features`]: struct.Features.html
26-
//! [`Context`]: sealed/trait.Context.html
23+
//! [messages]: `crate::ln::msgs`
2724
2825
use std::{cmp, fmt};
2926
use std::marker::PhantomData;
@@ -36,8 +33,6 @@ mod sealed {
3633

3734
/// The context in which [`Features`] are applicable. Defines which features are required and
3835
/// which are optional for the context.
39-
///
40-
/// [`Features`]: ../struct.Features.html
4136
pub trait Context {
4237
/// Features that are known to the implementation, where a required feature is indicated by
4338
/// its even bit and an optional feature is indicated by its odd bit.
@@ -51,8 +46,6 @@ mod sealed {
5146
/// Defines a [`Context`] by stating which features it requires and which are optional. Features
5247
/// are specified as a comma-separated list of bytes where each byte is a pipe-delimited list of
5348
/// feature identifiers.
54-
///
55-
/// [`Context`]: trait.Context.html
5649
macro_rules! define_context {
5750
($context: ident {
5851
required_features: [$( $( $required_feature: ident )|*, )*],
@@ -156,8 +149,6 @@ mod sealed {
156149

157150
/// Defines a feature with the given bits for the specified [`Context`]s. The generated trait is
158151
/// useful for manipulating feature flags.
159-
///
160-
/// [`Context`]: trait.Context.html
161152
macro_rules! define_feature {
162153
($odd_bit: expr, $feature: ident, [$($context: ty),+], $doc: expr, $optional_setter: ident,
163154
$required_setter: ident) => {
@@ -413,9 +404,7 @@ impl<T: sealed::Context> Features<T> {
413404
}
414405
}
415406

416-
/// Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
417-
///
418-
/// [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
407+
/// Creates a Features with the bits set which are known by the implementation
419408
pub fn known() -> Self {
420409
Self {
421410
flags: T::KNOWN_FEATURE_FLAGS.to_vec(),

0 commit comments

Comments
 (0)