pub struct ValidationErrors<Key> {
pub errors: Vec<ValidationError<Key>>,
}
Expand description
A collection of ValidationErrors as a result of validating the fields of a form.
Fields§
§errors: Vec<ValidationError<Key>>
Implementations§
Source§impl<Key> ValidationErrors<Key>
impl<Key> ValidationErrors<Key>
Sourcepub fn new(errors: Vec<ValidationError<Key>>) -> Self
pub fn new(errors: Vec<ValidationError<Key>>) -> Self
Create a new ValidationErrors
.
Sourcepub fn get(&self, key: &Key) -> Option<ValidationErrors<Key>>
pub fn get(&self, key: &Key) -> Option<ValidationErrors<Key>>
Get errors associated with the specified field key, or None
if there are no errors for that field.
Sourcepub fn extend(&mut self, errors: ValidationErrors<Key>)
pub fn extend(&mut self, errors: ValidationErrors<Key>)
Extend this collection of errors with the contents of another collection.
Trait Implementations§
Source§impl<Key: Clone> Clone for ValidationErrors<Key>
impl<Key: Clone> Clone for ValidationErrors<Key>
Source§fn clone(&self) -> ValidationErrors<Key>
fn clone(&self) -> ValidationErrors<Key>
Returns a copy 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<Key: Debug> Debug for ValidationErrors<Key>
impl<Key: Debug> Debug for ValidationErrors<Key>
Source§impl<Key> Default for ValidationErrors<Key>
impl<Key> Default for ValidationErrors<Key>
Source§impl<Key> Display for ValidationErrors<Key>
impl<Key> Display for ValidationErrors<Key>
Source§impl<Key> Error for ValidationErrors<Key>where
Key: Debug,
impl<Key> Error for ValidationErrors<Key>where
Key: Debug,
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<Key> From<ValidationError<Key>> for ValidationErrors<Key>
impl<Key> From<ValidationError<Key>> for ValidationErrors<Key>
Source§fn from(err: ValidationError<Key>) -> Self
fn from(err: ValidationError<Key>) -> Self
Converts to this type from the input type.
Source§impl<Key> PartialEq for ValidationErrors<Key>where
Key: PartialEq,
impl<Key> PartialEq for ValidationErrors<Key>where
Key: PartialEq,
Auto Trait Implementations§
impl<Key> Freeze for ValidationErrors<Key>
impl<Key> !RefUnwindSafe for ValidationErrors<Key>
impl<Key> !Send for ValidationErrors<Key>
impl<Key> !Sync for ValidationErrors<Key>
impl<Key> Unpin for ValidationErrors<Key>where
Key: Unpin,
impl<Key> !UnwindSafe for ValidationErrors<Key>
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