#[non_exhaustive]pub enum NumericComparisonError {
LeftMissing {
declared: DataType,
},
RightMissing {
declared: DataType,
},
LeftNotNumeric {
actual: DataType,
},
RightNotNumeric {
actual: DataType,
},
LeftNaN,
RightNaN,
BothNaN,
}Expand description
Describes why two crate::Value instances cannot be numerically ordered.
§Examples
use qubit_datatype::NumericComparisonPolicy;
use qubit_value::{NumericComparisonError, Value};
let error = Value::from("text")
.numeric_cmp(&Value::from(1_i32), NumericComparisonPolicy::Exact)
.unwrap_err();
assert!(matches!(error, NumericComparisonError::LeftNotNumeric { .. }));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.
LeftMissing
The left operand is unset but retains a declared type.
RightMissing
The right operand is unset but retains a declared type.
LeftNotNumeric
The concrete left operand is not numeric.
RightNotNumeric
The concrete right operand is not numeric.
LeftNaN
Only the left operand is NaN.
RightNaN
Only the right operand is NaN.
BothNaN
Both operands are NaN.
Trait Implementations§
Source§impl Clone for NumericComparisonError
impl Clone for NumericComparisonError
Source§fn clone(&self) -> NumericComparisonError
fn clone(&self) -> NumericComparisonError
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 NumericComparisonError
impl Debug for NumericComparisonError
Source§impl Display for NumericComparisonError
impl Display for NumericComparisonError
impl Eq for NumericComparisonError
Source§impl Error for NumericComparisonError
impl Error for NumericComparisonError
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 PartialEq for NumericComparisonError
impl PartialEq for NumericComparisonError
impl StructuralPartialEq for NumericComparisonError
Auto Trait Implementations§
impl Freeze for NumericComparisonError
impl RefUnwindSafe for NumericComparisonError
impl Send for NumericComparisonError
impl Sync for NumericComparisonError
impl Unpin for NumericComparisonError
impl UnsafeUnpin for NumericComparisonError
impl UnwindSafe for NumericComparisonError
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoValueDefault<T> for T
impl<T> IntoValueDefault<T> for T
Source§fn into_value_default(self) -> T
fn into_value_default(self) -> T
Converts this argument into the default value. Read more