pub enum DocumentValidationError {
MissingRequiredField(String),
InvalidType {
field_id: String,
expected_type: String,
got_type: String,
},
ValueTooLow {
field_id: String,
value: f64,
min: f64,
},
ValueTooHigh {
field_id: String,
value: f64,
max: f64,
},
InvalidSelection {
field_id: String,
value: String,
allowed: Vec<String>,
},
InvalidDateFormat {
field_id: String,
value: String,
},
FormIdMismatch {
doc_form: String,
def_id: String,
},
}Expand description
Represents errors encountered during the document validation process.
Variants§
MissingRequiredField(String)
Indicates that a required field was missing from the document or its value was null.
InvalidType
Indicates a type mismatch for a field’s value.
Fields
ValueTooLow
Indicates that a numerical field’s value is below its specified minimum.
Fields
ValueTooHigh
Indicates that a numerical field’s value is above its specified maximum.
Fields
InvalidSelection
Indicates that a selection field’s value is not among the allowed options.
Fields
InvalidDateFormat
Indicates that a date/time field’s value is not in a valid ISO 8601 format.
FormIdMismatch
Indicates that the document’s form_id does not match the FormDefinition’s ID.
Trait Implementations§
Source§impl Debug for DocumentValidationError
impl Debug for DocumentValidationError
Source§impl<'de> Deserialize<'de> for DocumentValidationError
impl<'de> Deserialize<'de> for DocumentValidationError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DocumentValidationError
impl Display for DocumentValidationError
Source§impl Error for DocumentValidationError
impl Error for DocumentValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for DocumentValidationError
impl PartialEq for DocumentValidationError
Source§impl Serialize for DocumentValidationError
impl Serialize for DocumentValidationError
impl StructuralPartialEq for DocumentValidationError
Auto Trait Implementations§
impl Freeze for DocumentValidationError
impl RefUnwindSafe for DocumentValidationError
impl Send for DocumentValidationError
impl Sync for DocumentValidationError
impl Unpin for DocumentValidationError
impl UnwindSafe for DocumentValidationError
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> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
Source§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
Source§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
Source§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP