pub struct ValidationError {
pub resource: String,
pub field: String,
pub code: ValidationErrorCode,
pub message: Option<String>,
}Expand description
Validation error detail.
Fields§
§resource: StringResource type.
field: StringField name.
code: ValidationErrorCodeError code.
message: Option<String>Additional message.
Implementations§
Source§impl ValidationError
impl ValidationError
Sourcepub fn new(
resource: impl Into<String>,
field: impl Into<String>,
code: ValidationErrorCode,
) -> Self
pub fn new( resource: impl Into<String>, field: impl Into<String>, code: ValidationErrorCode, ) -> Self
Create a new validation error.
Sourcepub fn with_message(
resource: impl Into<String>,
field: impl Into<String>,
code: ValidationErrorCode,
message: impl Into<String>,
) -> Self
pub fn with_message( resource: impl Into<String>, field: impl Into<String>, code: ValidationErrorCode, message: impl Into<String>, ) -> Self
Create with a message.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ValidationError
impl Debug for ValidationError
Source§impl<'de> Deserialize<'de> for ValidationError
impl<'de> Deserialize<'de> for ValidationError
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
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
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