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. |
||
---|---|---|
.. | ||
map | ||
error.rs | ||
macros.rs | ||
mod.rs | ||
raw.rs | ||
serialize.rs |