#[non_exhaustive]pub enum BeanError {
Amount(AmountError),
Currency(CurrencyError),
Money(MoneyError),
AccountCode(AccountCodeError),
AccountType(AccountTypeError),
DebitCredit(DebitCreditError),
Entry(EntryError),
Transaction(TransactionError),
}Expand description
Top-level error type aggregating all domain errors in the crate.
Each variant wraps a specific domain error, allowing callers to use
the ? operator with any beankeeper operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Amount(AmountError)
An error from monetary amount operations.
Currency(CurrencyError)
An error from currency operations.
Money(MoneyError)
An error from money operations.
AccountCode(AccountCodeError)
An error from account code validation.
AccountType(AccountTypeError)
An error from account type parsing.
DebitCredit(DebitCreditError)
An error from debit/credit parsing.
Entry(EntryError)
An error from entry construction.
Transaction(TransactionError)
An error from transaction validation.
Trait Implementations§
Source§impl Error for BeanError
impl Error for BeanError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<AccountCodeError> for BeanError
impl From<AccountCodeError> for BeanError
Source§fn from(err: AccountCodeError) -> Self
fn from(err: AccountCodeError) -> Self
Converts to this type from the input type.
Source§impl From<AccountTypeError> for BeanError
impl From<AccountTypeError> for BeanError
Source§fn from(err: AccountTypeError) -> Self
fn from(err: AccountTypeError) -> Self
Converts to this type from the input type.
Source§impl From<AmountError> for BeanError
impl From<AmountError> for BeanError
Source§fn from(err: AmountError) -> Self
fn from(err: AmountError) -> Self
Converts to this type from the input type.
Source§impl From<CurrencyError> for BeanError
impl From<CurrencyError> for BeanError
Source§fn from(err: CurrencyError) -> Self
fn from(err: CurrencyError) -> Self
Converts to this type from the input type.
Source§impl From<DebitCreditError> for BeanError
impl From<DebitCreditError> for BeanError
Source§fn from(err: DebitCreditError) -> Self
fn from(err: DebitCreditError) -> Self
Converts to this type from the input type.
Source§impl From<EntryError> for BeanError
impl From<EntryError> for BeanError
Source§fn from(err: EntryError) -> Self
fn from(err: EntryError) -> Self
Converts to this type from the input type.
Source§impl From<MoneyError> for BeanError
impl From<MoneyError> for BeanError
Source§fn from(err: MoneyError) -> Self
fn from(err: MoneyError) -> Self
Converts to this type from the input type.
Source§impl From<TransactionError> for BeanError
impl From<TransactionError> for BeanError
Source§fn from(err: TransactionError) -> Self
fn from(err: TransactionError) -> Self
Converts to this type from the input type.
impl Eq for BeanError
impl StructuralPartialEq for BeanError
Auto Trait Implementations§
impl Freeze for BeanError
impl RefUnwindSafe for BeanError
impl Send for BeanError
impl Sync for BeanError
impl Unpin for BeanError
impl UnsafeUnpin for BeanError
impl UnwindSafe for BeanError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more