Enum proof_of_sql::base::math::decimal::DecimalError
source · pub enum DecimalError {
InvalidDecimal(String),
InvalidPrecision(String),
InvalidScale(i16),
RoundingError(String),
IntermediateDecimalConversionError(IntermediateDecimalError),
}
Expand description
Errors related to decimal operations.
Variants§
InvalidDecimal(String)
Error when a decimal format or value is incorrect, the string isn’t even a decimal e.g. “notastring”, “-21.233.122” etc aka InvalidDecimal
InvalidPrecision(String)
Decimal precision exceeds the allowed limit, e.g. precision above 75/76/whatever set by Scalar or non-positive aka InvalidPrecision
InvalidScale(i16)
Decimal scale is not valid. Here we use i16 in order to include invalid scale values
RoundingError(String)
This error occurs when attempting to scale a decimal in such a way that a loss of precision occurs.
IntermediateDecimalConversionError(IntermediateDecimalError)
Errors that may occur when parsing an intermediate decimal into a posql decimal
Trait Implementations§
source§impl Debug for DecimalError
impl Debug for DecimalError
source§impl Display for DecimalError
impl Display for DecimalError
source§impl Error for DecimalError
impl Error for DecimalError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<DecimalError> for ConversionError
impl From<DecimalError> for ConversionError
source§fn from(source: DecimalError) -> Self
fn from(source: DecimalError) -> Self
Converts to this type from the input type.
source§impl PartialEq for DecimalError
impl PartialEq for DecimalError
source§fn eq(&self, other: &DecimalError) -> bool
fn eq(&self, other: &DecimalError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for DecimalError
impl StructuralPartialEq for DecimalError
Auto Trait Implementations§
impl Freeze for DecimalError
impl RefUnwindSafe for DecimalError
impl Send for DecimalError
impl Sync for DecimalError
impl Unpin for DecimalError
impl UnwindSafe for DecimalError
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more