[−][src]Struct validator::ValidationErrors
Methods
impl ValidationErrors
[src]
pub fn new() -> ValidationErrors
[src]
pub fn has_error(
result: &Result<(), ValidationErrors>,
field: &'static str
) -> bool
[src]
result: &Result<(), ValidationErrors>,
field: &'static str
) -> bool
Returns a boolean indicating whether a validation result includes validation errors for a given field. May be used as a condition for performing nested struct validations on a field in the absence of field-level validation errors.
pub fn merge(
parent: Result<(), ValidationErrors>,
field: &'static str,
child: Result<(), ValidationErrors>
) -> Result<(), ValidationErrors>
[src]
parent: Result<(), ValidationErrors>,
field: &'static str,
child: Result<(), ValidationErrors>
) -> Result<(), ValidationErrors>
Returns the combined outcome of a struct's validation result along with the nested validation result for one of its fields.
pub fn merge_all(
parent: Result<(), ValidationErrors>,
field: &'static str,
children: Vec<Result<(), ValidationErrors>>
) -> Result<(), ValidationErrors>
[src]
parent: Result<(), ValidationErrors>,
field: &'static str,
children: Vec<Result<(), ValidationErrors>>
) -> Result<(), ValidationErrors>
Returns the combined outcome of a struct's validation result along with the nested validation result for one of its fields where that field is a vector of validating structs.
pub fn errors(&self) -> &HashMap<&'static str, ValidationErrorsKind>
[src]
Returns a map of field-level validation errors found for the struct that was validated and any of it's nested structs that are tagged for validation.
pub fn into_errors(self) -> HashMap<&'static str, ValidationErrorsKind>
[src]
Consume the struct, returning the validation errors found
pub fn field_errors(&self) -> HashMap<&str, &Vec<ValidationError>>
[src]
Returns a map of only field-level validation errors found for the struct that was validated.
pub fn add(&mut self, field: &'static str, error: ValidationError)
[src]
pub fn is_empty(&self) -> bool
[src]
Trait Implementations
impl Clone for ValidationErrors
[src]
fn clone(&self) -> ValidationErrors
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for ValidationErrors
[src]
fn default() -> ValidationErrors
[src]
impl PartialEq<ValidationErrors> for ValidationErrors
[src]
fn eq(&self, other: &ValidationErrors) -> bool
[src]
fn ne(&self, other: &ValidationErrors) -> bool
[src]
impl Display for ValidationErrors
[src]
impl Debug for ValidationErrors
[src]
impl Error for ValidationErrors
[src]
fn description(&self) -> &str
[src]
fn cause(&self) -> Option<&dyn Error>
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
impl Serialize for ValidationErrors
[src]
Auto Trait Implementations
impl Send for ValidationErrors
impl Sync for ValidationErrors
impl Unpin for ValidationErrors
impl UnwindSafe for ValidationErrors
impl RefUnwindSafe for ValidationErrors
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,