pub enum ValidationErrorKind {
InvalidFormat {
field: String,
expected: String,
},
OutOfRange {
field: String,
min: Option<String>,
max: Option<String>,
},
Required {
field: String,
},
AlreadyExists {
field: String,
value: String,
},
NotAllowed {
field: String,
allowed: Vec<String>,
},
CustomValidation {
field: String,
message: String,
},
}Expand description
验证错误类型
Variants§
InvalidFormat
无效格式
OutOfRange
值超出范围
Required
必填字段缺失
AlreadyExists
值已存在
NotAllowed
值不允许
CustomValidation
自定义验证错误
Trait Implementations§
Source§impl Clone for ValidationErrorKind
impl Clone for ValidationErrorKind
Source§fn clone(&self) -> ValidationErrorKind
fn clone(&self) -> ValidationErrorKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidationErrorKind
impl Debug for ValidationErrorKind
Source§impl<'de> Deserialize<'de> for ValidationErrorKind
impl<'de> Deserialize<'de> for ValidationErrorKind
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 ValidationErrorKind
impl Display for ValidationErrorKind
Source§impl From<ValidationErrorKind> for WaeError
impl From<ValidationErrorKind> for WaeError
Source§fn from(kind: ValidationErrorKind) -> Self
fn from(kind: ValidationErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ValidationErrorKind
impl RefUnwindSafe for ValidationErrorKind
impl Send for ValidationErrorKind
impl Sync for ValidationErrorKind
impl Unpin for ValidationErrorKind
impl UnsafeUnpin for ValidationErrorKind
impl UnwindSafe for ValidationErrorKind
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