pub enum NumericError {
InvalidInputSyntax,
FormatOverflow,
DivisionByZero,
}Expand description
Why PostgreSQL refuses to read or compute a numeric, one variant per message it raises.
use sql_values::postgres::{NumericError, PgNumeric};
assert_eq!(PgNumeric::parse("1.5x"), Err(NumericError::InvalidInputSyntax));
let one = PgNumeric::from(1);
let zero = PgNumeric::from(0);
assert_eq!(one.checked_div(&zero), Err(NumericError::DivisionByZero));Variants§
InvalidInputSyntax
Text numeric_in cannot read.
FormatOverflow
A value beyond the weight or display scale PostgreSQL stores.
DivisionByZero
A division or remainder by zero.
Trait Implementations§
Source§impl Clone for NumericError
impl Clone for NumericError
impl Copy for NumericError
Source§impl Debug for NumericError
impl Debug for NumericError
Source§impl Display for NumericError
impl Display for NumericError
impl Eq for NumericError
Source§impl Error for NumericError
impl Error for NumericError
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()
Source§impl Hash for NumericError
impl Hash for NumericError
Source§impl PartialEq for NumericError
impl PartialEq for NumericError
impl StructuralPartialEq for NumericError
Auto Trait Implementations§
impl Forget for NumericError
impl Freeze for NumericError
impl Move for NumericError
impl RefUnwindSafe for NumericError
impl Send for NumericError
impl Sync for NumericError
impl Unpin for NumericError
impl UnsafeUnpin for NumericError
impl UnwindSafe for NumericError
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