units: Make fee module public

The `fee` module is now empty as far as API surface. It still holds the
`core::ops` impls for fee calculation. It also does have useful
rustdocs which are not currently visible online because module is
private.

Make the module public. Functionally all this does is provide a place
for the module level docs under a discoverable name.

Improve the docs by adding a bunch of links to fee related functions.
This commit is contained in:
Tobin C. Harding 2025-06-12 10:31:56 +10:00
parent 251e6a85da
commit 20c84ce444
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 13 additions and 1 deletions

View File

@ -10,6 +10,18 @@
//! //!
//! We provide `fee.checked_div_by_weight_ceil(weight)` to calculate a minimum threshold fee rate //! We provide `fee.checked_div_by_weight_ceil(weight)` to calculate a minimum threshold fee rate
//! required to pay at least `fee` for transaction with `weight`. //! required to pay at least `fee` for transaction with `weight`.
//!
//! We support various `core::ops` traits all of which return [`NumOpResult<T>`].
//!
//! For specific methods see:
//!
//! * [`Amount::checked_div_by_weight_floor`]
//! * [`Amount::checked_div_by_weight_ceil`]
//! * [`Amount::checked_div_by_fee_rate_floor`]
//! * [`Amount::checked_div_by_fee_rate_ceil`]
//! * [`Weight::checked_mul_by_fee_rate`]
//! * [`FeeRate::checked_mul_by_weight`]
//! * [`FeeRate::to_fee`]
use core::ops; use core::ops;

View File

@ -34,7 +34,6 @@ extern crate alloc;
#[cfg(feature = "std")] #[cfg(feature = "std")]
extern crate std; extern crate std;
mod fee;
mod internal_macros; mod internal_macros;
mod result; mod result;
@ -48,6 +47,7 @@ pub mod _export {
pub mod amount; pub mod amount;
pub mod block; pub mod block;
pub mod fee;
pub mod fee_rate; pub mod fee_rate;
pub mod locktime; pub mod locktime;
pub mod parse; pub mod parse;