pub enum IssueCode {
}Expand description
Stable, enumerable identifiers for every builtin constraint (ER-3), plus
IssueCode::Custom for consumer-defined ones.
Matchable today; additive variants in minor releases until v1 freezes it, so downstream matches should include a wildcard.
Variants§
Min
Value is shorter than the declared minimum length.
Max
Value exceeds the declared maximum length/bound.
Length
Length does not equal the declared exact length.
String does not look like an email address.
Url
String does not look like a URL.
Uuid
String does not look like a UUID.
Empty
String is empty where emptiness is forbidden.
Int
Number has a fractional part where an integer is required.
Positive
Number is zero or negative where positivity is required.
Finite
Float is NaN or infinite where finiteness is required.
BoolEquals
Boolean does not equal the expected value.
Coerce
String-to-type coercion failed.
Refine
A refinement closure rejected the value.
TypeMismatch
Erased-view value has the wrong variant for this schema.
Required
Declared object field is absent from the input object (purely structural: decided by key existence, never by the value found).
Custom(Box<str>)
Consumer-defined constraint identifier, carried verbatim from a
RefineRejection.
Builtins never produce this variant; it exists so a consumer running
several custom rules can tell them apart. IssueCode::Refine
collapses every rule into one code, which defeats keying a
translation table off IssueCode. The payload is an opaque
consumer namespace: formars neither interprets nor validates it.