pub enum ValidationViolation {
MissingField {
field: &'static str,
},
Empty {
field: &'static str,
},
InvalidFormat {
field: &'static str,
rule: &'static str,
},
InvalidValue {
field: &'static str,
rule: &'static str,
},
OutOfRange {
field: &'static str,
rule: &'static str,
},
Duplicate {
field: &'static str,
},
LimitExceeded {
field: &'static str,
limit: usize,
},
Incompatible {
field: &'static str,
other: &'static str,
},
Unsupported {
field: &'static str,
rule: &'static str,
},
}Expand description
A Kit-owned input invariant identified without disclosing caller values.
Labels are trusted static schema names and rules, never native diagnostic text.
Caller implementations can attach one with KitError::with_validation_violation.
use providers_kit::error::ValidationViolation;
let violation = ValidationViolation::OutOfRange {
field: "generation.temperature", rule: "finite and non-negative",
};
assert!(format!("{violation:?}").contains("generation.temperature"));Variants§
MissingField
A required field was not supplied.
Empty
A required value or collection was empty.
InvalidFormat
A value did not satisfy its required syntax.
Fields
InvalidValue
A value violated a non-range invariant.
OutOfRange
A value was outside its permitted range.
Duplicate
A value was repeated where uniqueness is required.
LimitExceeded
A value or collection exceeded a known limit.
Incompatible
Two fields cannot be used together.
Fields
Unsupported
The selected implementation cannot support the requested input feature.
Trait Implementations§
Source§impl Clone for ValidationViolation
impl Clone for ValidationViolation
impl Copy for ValidationViolation
Source§impl Debug for ValidationViolation
impl Debug for ValidationViolation
impl Eq for ValidationViolation
Source§impl PartialEq for ValidationViolation
impl PartialEq for ValidationViolation
impl StructuralPartialEq for ValidationViolation
Auto Trait Implementations§
impl Freeze for ValidationViolation
impl RefUnwindSafe for ValidationViolation
impl Send for ValidationViolation
impl Sync for ValidationViolation
impl Unpin for ValidationViolation
impl UnsafeUnpin for ValidationViolation
impl UnwindSafe for ValidationViolation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.