Merge rust-bitcoin/rust-bitcoin#4341: units: Improve crate level docs

53837d9a2e units: Improve crate level docs (Tobin C. Harding)

Pull request description:

  Add a bit more to the crate level docs. This is a simple crate so we don't need all that much.

  Done for: C-CRATE-DOC

ACKs for top commit:
  apoelstra:
    ACK 53837d9a2e1cc70e180de39c16e2d212e958a9f3; successfully ran local tests

Tree-SHA512: 374c27a25cdc9bd4edd0755be02cad66ccccedcd69836506c1f4eb86a1254bfafe11eeb6fcc27b7efd2ab3ca0acd1daa304d482c7e5a7f84ffbcffbb1bcd21d6
This commit is contained in:
merge-script 2025-04-15 15:12:26 +00:00
commit c14044e76e
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 14 additions and 0 deletions

View File

@ -3,6 +3,20 @@
//! # Rust Bitcoin - unit types
//!
//! This library provides basic types used by the Rust Bitcoin ecosystem.
//!
//! If you are using `rust-bitcoin` then you do not need to access this crate directly. Everything
//! here is re-exported in `rust-bitcoin` at the same path. Also the same re-exports exist in
//! `primitives` if you are using that crate instead of `bitcoin`.
//!
//! # Examples
//!
//! ```
//! // Exactly the same as `use bitcoin::{amount, Amount}`.
//! use bitcoin_units::{amount, Amount};
//!
//! let amount = Amount::from_sat(1_000)?;
//! # Ok::<_, amount::OutOfRangeError>(())
//! ```
#![no_std]
// Experimental features we need.