pub enum ValidationError {
AccountAlreadyOpen {
account: AccountName,
date: NaiveDate,
},
AccountNotOpen {
account: AccountName,
date: NaiveDate,
},
CommodityAlreadyDeclared {
commodity: CommodityName,
date: NaiveDate,
},
CommodityNotDeclared {
commodity: CommodityName,
date: NaiveDate,
},
PayeeAlreadyDeclared {
payee: String,
},
PayeeNotDeclared {
payee: String,
date: NaiveDate,
},
TooManyPostingsWithoutAmount {
count: usize,
date: NaiveDate,
},
AmbiguousAutoBalanceCommodity {
commodities: Vec<String>,
date: NaiveDate,
},
TransactionNotBalanced {
commodity: String,
sum: Decimal,
date: NaiveDate,
},
CommodityNotAllowed {
account: AccountName,
commodity: CommodityName,
date: NaiveDate,
},
BalanceAssertionFailed {
account: AccountName,
commodity: CommodityName,
date: NaiveDate,
expected: Decimal,
actual: Decimal,
tolerance: Decimal,
},
}Expand description
Errors raised when validating a crate::Journal as a whole: checks
that require knowing about other entries of the journal, as opposed to
the purely grammatical checks reported as ModelError.
Variants§
AccountAlreadyOpen
An account is opened while it is already open.
Fields
account: AccountNameAccount name involved in the duplicate opening.
AccountNotOpen
An account is used or closed while it is not open.
Fields
account: AccountNameAccount name that was used while closed or unopened.
CommodityAlreadyDeclared
A commodity is declared more than once.
Fields
commodity: CommodityNameCommodity declared more than once.
CommodityNotDeclared
A commodity is used before being declared.
Fields
commodity: CommodityNameCommodity used before its declaration.
PayeeAlreadyDeclared
A payee is declared more than once.
PayeeNotDeclared
A transaction uses a payee that has not been declared.
TooManyPostingsWithoutAmount
More than one transaction posting has no amount.
AmbiguousAutoBalanceCommodity
The commodity of an inferred amount cannot be determined uniquely.
Fields
TransactionNotBalanced
Explicit transaction postings do not balance.
Fields
CommodityNotAllowed
A posting uses a commodity excluded by the account’s opening.
Fields
account: AccountNameAccount carrying the restricted commodity.
commodity: CommodityNameCommodity excluded by the account opening.
BalanceAssertionFailed
A balance assertion differs from the calculated balance beyond tolerance.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
impl Eq for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()