use-currency 0.1.0

Lightweight currency code primitives for RustUse finance crates
Documentation
  • Coverage
  • 100%
    16 out of 16 items documented1 out of 6 items with examples
  • Size
  • Source code size: 7.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 460.21 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-finance
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-currency

Lightweight currency code primitives for RustUse finance crates.

use-currency validates uppercase 3-letter alphabetic currency code identifiers without fetching exchange rates or currency metadata.

Example

use use_currency::{CurrencyCode, USD};

let currency = CurrencyCode::new(USD)?;

assert_eq!(currency.as_str(), "USD");
assert!(CurrencyCode::new("usd").is_err());
# Ok::<(), Box<dyn std::error::Error>>(())

Scope

Use this crate for small validated currency identifiers. It does not provide exchange rates, currency metadata downloads, locale formatting, decimal arithmetic, or money values.

License

Licensed under either MIT or Apache-2.0.