pub enum BillingError {
InvalidInput {
reason: String,
},
MonetaryOverflow {
input_value: Option<Decimal>,
},
}Expand description
Errors returned by the billing calculation functions.
Variants§
InvalidInput
The billing input contains an invalid or inconsistent value.
Fields
MonetaryOverflow
Monetary precision overflow — the calculated amount exceeds i64 range.
This can only happen for unrealistically large billing amounts (> ~92 million EUR).
input_value carries the Decimal that caused the overflow so callers can log it.
Trait Implementations§
Source§impl Clone for BillingError
impl Clone for BillingError
Source§fn clone(&self) -> BillingError
fn clone(&self) -> BillingError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BillingError
impl Debug for BillingError
Source§impl Display for BillingError
impl Display for BillingError
Source§impl Error for BillingError
impl Error for BillingError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for BillingError
impl RefUnwindSafe for BillingError
impl Send for BillingError
impl Sync for BillingError
impl Unpin for BillingError
impl UnsafeUnpin for BillingError
impl UnwindSafe for BillingError
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