pub enum ErrorKind {
Missing,
Empty,
OutOfRange {
lower: Option<String>,
upper: Option<String>,
},
TooShort {
min: usize,
actual: usize,
},
TooLong {
max: usize,
actual: usize,
},
NotOneOf {
allowed: Vec<String>,
},
Inconsistent {
related: Vec<String>,
code: &'static str,
},
Predicate {
code: &'static str,
},
}Expand description
The structured reason a value failed validation.
Each variant maps to a stable code string (Pydantic’s “type”),
suitable for programmatic matching, while carrying the specifics inline.
Variants§
Missing
A required value was absent.
Empty
A string/collection was empty but must not be.
OutOfRange
A number fell outside the allowed range.
Fields
TooShort
A string/collection was shorter than allowed.
TooLong
A string/collection was longer than allowed.
NotOneOf
A value was not among the permitted choices.
Inconsistent
A cross-field DECLARE constraint was violated.
related names the other field(s) involved in the constraint.
Fields
The other field names that form this cross-field constraint.
Predicate
A custom predicate failed; code is a caller-chosen stable identifier.
Implementations§
Trait Implementations§
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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<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.