Crate monetary

Source

Modules§

__derive_import

Structs§

AmountU128
CheckedCoin
Denom
Precise
Rate
A rate representing A / B.

Enums§

MonetaryError

Traits§

Denomination
Marker trait for a Zero-Sized-Type representing a denomination. You’ll likely want to implement this trait simply by declaring an empty struct, and then using the #[denom] attribute macro on it. monetary_macros::denom
Exchange

Functions§

amount
coin
coins
may_pay
Similar to must_pay, but it any payment is optional. Returns an error if a different denom was sent. Otherwise, returns the amount of denom sent, or 0 if nothing sent.
must_pay
Requires exactly one denom sent, which matches the requested denom. Returns the amount if only one denom and non-zero amount. Errors otherwise.

Attribute Macros§

denom
This macro: