[][src]Struct validator::ValidationErrors

pub struct ValidationErrors(_);

Methods

impl ValidationErrors[src]

pub fn new() -> ValidationErrors[src]

pub fn has_error(
    result: &Result<(), ValidationErrors>,
    field: &'static str
) -> bool
[src]

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]

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]

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]

impl Default for ValidationErrors[src]

impl PartialEq<ValidationErrors> for ValidationErrors[src]

impl Display for ValidationErrors[src]

impl Debug for ValidationErrors[src]

impl Error for ValidationErrors[src]

impl Serialize for ValidationErrors[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]