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. |
||
---|---|---|
.. | ||
contrib | ||
src | ||
tests | ||
CHANGELOG.md | ||
Cargo.toml | ||
README.md |
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.