rust-bitcoin-unsafe-fast/units
Tobin C. Harding 6244cb75fa
Introduce monadic AmountOpResult
We would like to return an error when doing math ops on amount types.
We cannot however use the stdlib `Result` or `Option` because we want to
implement ops on the result type.

Add an `AmountOpResult` type. Return this type from all math operations
on `Amount` and `SignedAmount`.

Implement `core::iter::Sum` for the new type to allow summing iterators
of amounts - somewhat ugly to use, see tests for example usage.
2025-02-10 10:06:59 +11:00
..
contrib Add Arbitrary dependency 2024-08-23 15:39:20 -05:00
src Introduce monadic AmountOpResult 2025-02-10 10:06:59 +11:00
tests units: Test for dyn compatibility 2025-01-20 09:39:38 +11:00
CHANGELOG.md Add unreleased changelog entry 2025-01-25 06:52:26 +11:00
Cargo.toml Merge rust-bitcoin/rust-bitcoin#3900: units: Fix `missing_errors_doc` clippy lint 2025-01-16 05:13:28 +00:00
README.md Bump MSRV to 1.63 2024-07-27 07:24:32 +02:00

README.md

Bitcoin Units

This crate provides basic Bitcoin numeric units such as Amount.

Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on Rust 1.63.0.

Licensing

The code in this project is licensed under the Creative Commons CC0 1.0 Universal license. We use the SPDX license list and SPDX IDs.