[−][src]Function valid::invalid_optional_value
pub fn invalid_optional_value(
code: impl Into<Cow<'static, str>>,
field_name: impl Into<FieldName>,
actual: Option<Value>,
expected: Option<Value>
) -> ConstraintViolation
Convenience function to construct a ConstraintViolation
for a validation
performed in the FieldName
context.
Use this method if the field value is optional. If the field is not of type
Option<T>
consider using the invalid_value
method instead.