pub enum ErrorCode {
UnexpectedField,
Cardinality,
TypeMismatch,
NullNotAllowed,
ShapeMismatch,
}Expand description
A stable machine-readable validation failure code, mirroring the Python
reference’s Error.code values.
Variants§
UnexpectedField
A field was found in the document that is not defined on the record.
Cardinality
The number of field occurrences fell outside [min, max].
TypeMismatch
A value did not match the expected type.
NullNotAllowed
A null value was encountered for a non-nullable field.
ShapeMismatch
A record was encountered where a scalar was expected, or vice-versa.
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub fn as_str(&self, family: ErrorFamily) -> &'static str
pub fn as_str(&self, family: ErrorFamily) -> &'static str
Stable, family-namespaced error code string per omnist-spec
§8.3.1 (<family>.<case>, e.g. validate.shape-mismatch).
TypeMismatch under Materialize is the one case that isn’t a
literal materialize.type-mismatch: materialize’s type-mismatch
check is specifically “this value can’t be upgraded to the field’s
kind without loss or ambiguity,” which §8.3.1 names
materialize.inexact-conversion.
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.