pub struct ValidationErrors { /* private fields */ }Expand description
Path-keyed validation error bag for nested forms.
Implementations§
Source§impl ValidationErrors
impl ValidationErrors
pub fn is_empty(&self) -> bool
pub fn get(&self, path: &str) -> Option<&String>
pub fn set(&mut self, path: &str, value: Option<String>)
pub fn remove(&mut self, path: &str)
Sourcepub fn reindex_array(&mut self, prefix: &str, len: usize)
pub fn reindex_array(&mut self, prefix: &str, len: usize)
Reindex array-path errors after removing/reordering rows.
Keys are expected in dotted form, for example:
addresses.0.street, addresses.1.city.
pub fn as_map(&self) -> &BTreeMap<String, String>
pub fn html(&self, path: &str) -> String
Trait Implementations§
Source§impl Clone for ValidationErrors
impl Clone for ValidationErrors
Source§fn clone(&self) -> ValidationErrors
fn clone(&self) -> ValidationErrors
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 ValidationErrors
impl Debug for ValidationErrors
Source§impl Default for ValidationErrors
impl Default for ValidationErrors
Source§fn default() -> ValidationErrors
fn default() -> ValidationErrors
Returns the “default value” for a type. Read more
Source§impl PartialEq for ValidationErrors
impl PartialEq for ValidationErrors
Source§fn eq(&self, other: &ValidationErrors) -> bool
fn eq(&self, other: &ValidationErrors) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ValidationErrors
impl StructuralPartialEq for ValidationErrors
Auto Trait Implementations§
impl Freeze for ValidationErrors
impl RefUnwindSafe for ValidationErrors
impl Send for ValidationErrors
impl Sync for ValidationErrors
impl Unpin for ValidationErrors
impl UnsafeUnpin for ValidationErrors
impl UnwindSafe for ValidationErrors
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