Crate monetary

source ·

Modules§

Structs§

Enums§

Traits§

  • 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

Functions§

  • 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.
  • 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§