Struct validator::ValidationErrors [−][src]
pub struct ValidationErrors(_);
Methods
impl ValidationErrors
[src]
impl ValidationErrors
pub fn new() -> ValidationErrors
[src]
pub fn new() -> ValidationErrors
pub fn has_error(
result: &Result<(), ValidationErrors>,
field: &'static str
) -> bool
[src]
pub fn has_error(
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]
pub fn merge(
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]
pub fn merge_all(
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]
pub fn errors(self) -> HashMap<&'static str, ValidationErrorsKind>
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 field_errors(self) -> HashMap<&'static str, Vec<ValidationError>>
[src]
pub fn field_errors(self) -> HashMap<&'static str, Vec<ValidationError>>
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 add(&mut self, field: &'static str, error: ValidationError)
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Trait Implementations
impl Default for ValidationErrors
[src]
impl Default for ValidationErrors
fn default() -> ValidationErrors
[src]
fn default() -> ValidationErrors
Returns the "default value" for a type. Read more
impl Debug for ValidationErrors
[src]
impl Debug for ValidationErrors
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for ValidationErrors
[src]
impl Clone for ValidationErrors
fn clone(&self) -> ValidationErrors
[src]
fn clone(&self) -> ValidationErrors
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for ValidationErrors
[src]
impl PartialEq for ValidationErrors
fn eq(&self, other: &ValidationErrors) -> bool
[src]
fn eq(&self, other: &ValidationErrors) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ValidationErrors) -> bool
[src]
fn ne(&self, other: &ValidationErrors) -> bool
This method tests for !=
.
impl Error for ValidationErrors
[src]
impl Error for ValidationErrors
fn description(&self) -> &str
[src]
fn description(&self) -> &str
This method is soft-deprecated. Read more
fn cause(&self) -> Option<&Error>
[src]
fn cause(&self) -> Option<&Error>
The lower-level cause of this error, if any. Read more
impl Display for ValidationErrors
[src]
impl Display for ValidationErrors
Auto Trait Implementations
impl Send for ValidationErrors
impl Send for ValidationErrors
impl Sync for ValidationErrors
impl Sync for ValidationErrors