units: Improve crate level docs

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
This commit is contained in:
Tobin C. Harding 2025-04-08 13:42:53 +10:00
parent e2149ec4e9
commit 53837d9a2e
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 14 additions and 0 deletions

View File

@ -3,6 +3,20 @@
//! # Rust Bitcoin - unit types //! # Rust Bitcoin - unit types
//! //!
//! This library provides basic types used by the Rust Bitcoin ecosystem. //! 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] #![no_std]
// Experimental features we need. // Experimental features we need.