pub enum ErrorKind {
Show 13 variants
Type {
expected: ValueType,
found: ValueType,
},
NotConvertible {
target: ValueType,
found: ValueType,
},
Format {
expected: &'static str,
},
BelowMin {
value: String,
min: String,
},
AboveMax {
value: String,
max: String,
},
TooShort {
len: usize,
min: usize,
},
TooLong {
len: usize,
max: usize,
},
PatternMismatch {
pattern: String,
},
Duplicate {
index: usize,
},
MissingKey {
key: String,
},
UnknownKey {
key: String,
},
NotAllowed {
value: String,
},
Either {
first: Box<Error>,
second: Box<Error>,
},
}Expand description
What went wrong while validating a value.
Variants§
Type
Wrong variant and no coercion applies.
NotConvertible
Right variant family but the contents cannot be coerced to the target.
Format
A semantic format check failed (host, email, uuid, …).
BelowMin
Numeric value below the inclusive minimum.
AboveMax
Numeric value above the inclusive maximum.
TooShort
String/list/map shorter than the minimum length.
TooLong
String/list/map longer than the maximum length.
PatternMismatch
String did not match the required pattern.
Duplicate
A duplicate item was found in a list required to be unique.
MissingKey
A required key was missing from a map.
UnknownKey
A key not declared in the schema was present in a map.
NotAllowed
A value was not in the allow-list (Enum).
Either
Neither alternative of an Either accepted the value.
Trait Implementations§
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