#[non_exhaustive]pub enum ValueError {
JsonProjectionLimit {
data_type: DataType,
source_index: Option<usize>,
source: MeasuredBudgetError<ConversionResource, u64>,
},
Missing(ValueMissing),
TypeMismatch {
expected: DataType,
actual: DataType,
},
Conversion(DataConversionError),
ListConversion(DataListConversionError),
}Expand description
Value processing error type
Defines various error conditions that may occur during value operations. Downstream matches must include a wildcard arm because this enum is non-exhaustive and may gain new error variants.
§Features
- Type mismatch error
- Structured missing-value errors
- Structured single-value conversion errors when
converteris enabled - Structured list conversion errors, including the failing item index, when
converteris enabled
§Examples
use qubit_datatype::DataType;
use qubit_value::{ValueError, ValueMissing};
let error = ValueError::Missing(ValueMissing::unset_scalar(DataType::String, DataType::String));
assert_eq!(error.missing().unwrap().target_type(), Some(DataType::String));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
JsonProjectionLimit
Resource rejection before materializing a natural JSON projection.
Fields
source: MeasuredBudgetError<ConversionResource, u64>Exact rejected resource measurement, including its configured bound.
Missing(ValueMissing)
No concrete item is available from typed runtime storage or conversion.
Tuple Fields
0: ValueMissingStructured typed storage state that caused the missing value.
TypeMismatch
Type mismatch
Conversion(DataConversionError)
Error returned by the shared single-value conversion layer.
Tuple Fields
0: DataConversionErrorStructured conversion failure from qubit-datatype.
ListConversion(DataListConversionError)
Error returned by the shared list conversion layer.
Tuple Fields
0: DataListConversionErrorStructured list conversion failure, including the source index.
Implementations§
Source§impl ValueError
impl ValueError
Sourcepub const fn is_missing(&self) -> bool
pub const fn is_missing(&self) -> bool
Sourcepub const fn missing(&self) -> Option<&ValueMissing>
pub const fn missing(&self) -> Option<&ValueMissing>
Returns the structured missing-value reason, when present.
§Returns
Some(reason) for Self::Missing and None for every other variant.
Trait Implementations§
Source§impl Clone for ValueError
impl Clone for ValueError
Source§fn clone(&self) -> ValueError
fn clone(&self) -> ValueError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValueError
impl Debug for ValueError
Source§impl Display for ValueError
impl Display for ValueError
impl Eq for ValueError
Source§impl Error for ValueError
impl Error for ValueError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<DataConversionError> for ValueError
Available on crate feature converter only.
impl From<DataConversionError> for ValueError
converter only.Source§fn from(error: DataConversionError) -> Self
fn from(error: DataConversionError) -> Self
Source§impl From<DataListConversionError> for ValueError
Available on crate feature converter only.
impl From<DataListConversionError> for ValueError
converter only.