Skip to main content

moneylib/
lib.rs

1#![doc = include_str!("../README.md")]
2#![forbid(unsafe_code)]
3#![forbid(clippy::float_arithmetic)]
4#![forbid(clippy::float_cmp)]
5#![forbid(clippy::as_conversions)]
6#![forbid(clippy::cast_possible_truncation)]
7#![forbid(clippy::cast_sign_loss)]
8#![forbid(clippy::cast_possible_wrap)]
9#![forbid(clippy::unwrap_used)]
10
11pub use rust_decimal::Decimal;
12
13/// Contains helper macros.
14pub mod macros;
15
16mod base;
17pub use base::{BaseMoney, BaseOps, CustomMoney, IterOps, RoundingStrategy};
18
19mod error;
20pub use error::MoneyError;
21
22pub use currencylib::Currency;
23
24/// Contains all ISO 4217 currencies.
25pub mod iso {
26    pub use currencylib::*;
27}
28
29mod money;
30pub use money::Money;
31
32mod dec_ops;
33mod iter_ops;
34mod ops;
35mod percent_ops;
36pub use percent_ops::PercentOps;
37
38#[cfg(feature = "raw_money")]
39mod raw_money;
40#[cfg(feature = "raw_money")]
41pub use raw_money::RawMoney;
42
43#[cfg(feature = "serde")]
44/// Serde implementations
45pub mod serde;
46
47#[cfg(feature = "exchange")]
48mod exchange;
49#[cfg(feature = "exchange")]
50pub use exchange::{Exchange, ExchangeRates};
51
52#[cfg(feature = "accounting")]
53/// Accounting module
54pub mod accounting;
55
56mod fmt;
57
58mod parse;
59
60#[cfg(feature = "accounting")]
61mod calendar;
62
63#[cfg(test)]
64mod parse_test;
65
66#[cfg(test)]
67mod fmt_test;
68
69#[cfg(test)]
70mod money_test;
71
72#[cfg(test)]
73mod error_test;
74
75#[cfg(test)]
76mod ops_test;
77
78#[cfg(test)]
79mod iter_ops_test;
80
81#[cfg(test)]
82mod percent_ops_test;
83
84#[cfg(all(test, feature = "exchange"))]
85mod exchange_test;
86
87#[cfg(all(test, feature = "accounting"))]
88mod calendar_test;