pub enum FacetError {
Show 17 variants
LengthViolation {
message: String,
},
MinLengthViolation {
actual: u64,
min: u64,
},
MaxLengthViolation {
actual: u64,
max: u64,
},
PatternViolation {
value: String,
pattern: String,
},
EnumerationViolation {
value: String,
},
MinInclusiveViolation {
value: String,
min: String,
},
MaxInclusiveViolation {
value: String,
max: String,
},
MinExclusiveViolation {
value: String,
min: String,
},
MaxExclusiveViolation {
value: String,
max: String,
},
TotalDigitsViolation {
actual: u32,
max: u32,
},
FractionDigitsViolation {
actual: u32,
max: u32,
},
ExplicitTimezoneViolation {
message: String,
},
InvalidPattern {
pattern: String,
message: String,
},
DerivationRestriction {
message: String,
},
FixedFacetViolation {
facet_name: String,
base_value: String,
derived_value: String,
},
ConflictingFacets {
message: String,
},
NotApplicable {
facet: String,
type_name: String,
},
}Expand description
Facet-related errors (validation and derivation)
Variants§
LengthViolation
Value violates length constraint
MinLengthViolation
Value violates minLength constraint
MaxLengthViolation
Value violates maxLength constraint
PatternViolation
Value doesn’t match pattern
EnumerationViolation
Value not in enumeration
MinInclusiveViolation
Value violates minInclusive constraint
MaxInclusiveViolation
Value violates maxInclusive constraint
MinExclusiveViolation
Value violates minExclusive constraint
MaxExclusiveViolation
Value violates maxExclusive constraint
TotalDigitsViolation
Value violates totalDigits constraint
FractionDigitsViolation
Value violates fractionDigits constraint
ExplicitTimezoneViolation
Value violates explicitTimezone constraint
InvalidPattern
Invalid pattern regex
DerivationRestriction
Facet derivation error - derived type is not more restrictive
FixedFacetViolation
Facet derivation error - fixed facet cannot be overridden
ConflictingFacets
Facet derivation error - conflicting facets
NotApplicable
Facet not applicable to this type
Implementations§
Source§impl FacetError
impl FacetError
Sourcepub fn pattern(value: impl Into<String>, pattern: impl Into<String>) -> Self
pub fn pattern(value: impl Into<String>, pattern: impl Into<String>) -> Self
Create a pattern violation error
Sourcepub fn enumeration(value: impl Into<String>) -> Self
pub fn enumeration(value: impl Into<String>) -> Self
Create an enumeration violation error
Sourcepub fn derivation(message: impl Into<String>) -> Self
pub fn derivation(message: impl Into<String>) -> Self
Create a derivation restriction error
Sourcepub fn fixed_violation(
facet_name: impl Into<String>,
base_value: impl Into<String>,
derived_value: impl Into<String>,
) -> Self
pub fn fixed_violation( facet_name: impl Into<String>, base_value: impl Into<String>, derived_value: impl Into<String>, ) -> Self
Create a fixed facet violation error
Sourcepub fn conflicting(message: impl Into<String>) -> Self
pub fn conflicting(message: impl Into<String>) -> Self
Create a conflicting facets error
Trait Implementations§
Source§impl Clone for FacetError
impl Clone for FacetError
Source§fn clone(&self) -> FacetError
fn clone(&self) -> FacetError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FacetError
impl Debug for FacetError
Source§impl Display for FacetError
impl Display for FacetError
Source§impl Error for FacetError
impl Error for FacetError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()