Merge rust-bitcoin/rust-bitcoin#3550: primitives: Add rustdoc links back in

32bc68d4dc primitives: Add rustdoc links back in (Tobin C. Harding)

Pull request description:

  During move of code to `primitives` we removed a few links to types that were not yet moved, we can now put these back in.

  Close: #2997

ACKs for top commit:
  apoelstra:
    ACK 32bc68d4dcbbb9a15694df56743ae550de0c805c; successfully ran local tests
  jamillambert:
    ACK 32bc68d4dc

Tree-SHA512: 952bd9c2e358aed4dc8b40f6f98d11ef2f52acb9366587a81033663a16745d2fb68003b043516b3ef3faf788742910cccb40ffa8b515bb3ad189131425f969bf
This commit is contained in:
merge-script 2024-11-02 14:27:16 +00:00
commit 538c8cb227
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
3 changed files with 13 additions and 12 deletions

View File

@ -14,8 +14,8 @@ use arbitrary::{Arbitrary, Unstructured};
use mutagen::mutate; use mutagen::mutate;
use units::parse::{self, PrefixedHexError, UnprefixedHexError}; use units::parse::{self, PrefixedHexError, UnprefixedHexError};
#[cfg(doc)] #[cfg(all(doc, feature = "alloc"))]
use crate::absolute; use crate::{absolute, Transaction};
#[rustfmt::skip] // Keep public re-exports separate. #[rustfmt::skip] // Keep public re-exports separate.
#[doc(inline)] #[doc(inline)]
@ -24,14 +24,14 @@ pub use units::locktime::absolute::{ConversionError, Height, ParseHeightError, P
/// An absolute lock time value, representing either a block height or a UNIX timestamp (seconds /// An absolute lock time value, representing either a block height or a UNIX timestamp (seconds
/// since epoch). /// since epoch).
/// ///
/// Used for transaction lock time (`nLockTime` in Bitcoin Core and `Transaction::lock_time` /// Used for transaction lock time (`nLockTime` in Bitcoin Core and [`Transaction::lock_time`]
/// in this library) and also for the argument to opcode 'OP_CHECKLOCKTIMEVERIFY`. /// in this library) and also for the argument to opcode 'OP_CHECKLOCKTIMEVERIFY`.
/// ///
/// ### Note on ordering /// ### Note on ordering
/// ///
/// Locktimes may be height- or time-based, and these metrics are incommensurate; there is no total /// Locktimes may be height- or time-based, and these metrics are incommensurate; there is no total
/// ordering on locktimes. We therefore have implemented [`PartialOrd`] but not [`Ord`]. /// ordering on locktimes. We therefore have implemented [`PartialOrd`] but not [`Ord`].
/// For `Transaction`, which has a locktime field, we implement a total ordering to make /// For [`Transaction`], which has a locktime field, we implement a total ordering to make
/// it easy to store transactions in sorted data structures, and use the locktime's 32-bit integer /// it easy to store transactions in sorted data structures, and use the locktime's 32-bit integer
/// consensus encoding to order it. We also implement [`ordered::ArbitraryOrd`] if the "ordered" /// consensus encoding to order it. We also implement [`ordered::ArbitraryOrd`] if the "ordered"
/// feature is enabled. /// feature is enabled.
@ -85,7 +85,7 @@ pub enum LockTime {
} }
impl LockTime { impl LockTime {
/// If `Transaction::lock_time` is set to zero it is ignored, in other words a /// If [`Transaction::lock_time`] is set to zero it is ignored, in other words a
/// transaction with nLocktime==0 is able to be included immediately in any block. /// transaction with nLocktime==0 is able to be included immediately in any block.
pub const ZERO: LockTime = LockTime::Blocks(Height::ZERO); pub const ZERO: LockTime = LockTime::Blocks(Height::ZERO);
@ -197,7 +197,7 @@ impl LockTime {
/// blocktime based lock it is checked against `time`. /// blocktime based lock it is checked against `time`.
/// ///
/// A 'timelock constraint' refers to the `n` from `n OP_CHEKCLOCKTIMEVERIFY`, this constraint /// A 'timelock constraint' refers to the `n` from `n OP_CHEKCLOCKTIMEVERIFY`, this constraint
/// is satisfied if a transaction with nLockTime (`Transaction::lock_time`) set to /// is satisfied if a transaction with nLockTime ([`Transaction::lock_time`]) set to
/// `height`/`time` is valid. /// `height`/`time` is valid.
/// ///
/// # Examples /// # Examples

View File

@ -12,8 +12,8 @@ use core::{cmp, convert, fmt};
#[cfg(all(test, mutate))] #[cfg(all(test, mutate))]
use mutagen::mutate; use mutagen::mutate;
#[cfg(doc)] #[cfg(all(doc, feature = "alloc"))]
use crate::relative; use crate::{relative, TxIn};
use crate::Sequence; use crate::Sequence;
#[rustfmt::skip] // Keep public re-exports separate. #[rustfmt::skip] // Keep public re-exports separate.
@ -22,7 +22,7 @@ pub use units::locktime::relative::{Height, Time, TimeOverflowError};
/// A relative lock time value, representing either a block height or time (512 second intervals). /// A relative lock time value, representing either a block height or time (512 second intervals).
/// ///
/// Used for sequence numbers (`nSequence` in Bitcoin Core and `TxIn::sequence` /// Used for sequence numbers (`nSequence` in Bitcoin Core and [`TxIn::sequence`]
/// in this library) and also for the argument to opcode 'OP_CHECKSEQUENCEVERIFY`. /// in this library) and also for the argument to opcode 'OP_CHECKSEQUENCEVERIFY`.
/// ///
/// ### Note on ordering /// ### Note on ordering

View File

@ -3,8 +3,7 @@
//! Bitcoin transaction input sequence number. //! Bitcoin transaction input sequence number.
//! //!
//! The sequence field is used for: //! The sequence field is used for:
//! - Indicating whether absolute lock-time (specified in `lock_time` field of `Transaction`) //! - Indicating whether absolute lock-time (specified in `lock_time` field of [`Transaction`]) is enabled.
//! is enabled.
//! - Indicating and encoding [BIP-68] relative lock-times. //! - Indicating and encoding [BIP-68] relative lock-times.
//! - Indicating whether a transaction opts-in to [BIP-125] replace-by-fee. //! - Indicating whether a transaction opts-in to [BIP-125] replace-by-fee.
//! //!
@ -28,6 +27,8 @@ use units::parse::{self, PrefixedHexError, UnprefixedHexError};
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
use crate::locktime::relative; use crate::locktime::relative;
#[cfg(all(doc, feature = "alloc"))]
use crate::transaction::Transaction;
/// Bitcoin transaction input sequence number. /// Bitcoin transaction input sequence number.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
@ -74,7 +75,7 @@ impl Sequence {
/// BIP-68 relative lock time type flag mask. /// BIP-68 relative lock time type flag mask.
const LOCK_TYPE_MASK: u32 = 0x00400000; const LOCK_TYPE_MASK: u32 = 0x00400000;
/// Returns `true` if the sequence number enables absolute lock-time (`Transaction::lock_time`). /// Returns `true` if the sequence number enables absolute lock-time ([`Transaction::lock_time`]).
#[inline] #[inline]
pub fn enables_absolute_lock_time(&self) -> bool { *self != Sequence::MAX } pub fn enables_absolute_lock_time(&self) -> bool { *self != Sequence::MAX }