pub struct FieldErrors<K = String> { /* private fields */ }Expand description
A refused submission.
Resource::validate_record keys it by the record form’s
field enum (FieldErrors<UserFormField>), so an error always names a field the form renders;
one on an embedded value renders under its first control. The panel keys every error by the
form key it renders under (FieldErrors, keyed by String), and Source::form reads them
back when a schema renders.
Implementations§
Source§impl<K> FieldErrors<K>
impl<K> FieldErrors<K>
Sourcepub fn push(&mut self, error: FieldError<K>)
pub fn push(&mut self, error: FieldError<K>)
Refuse error’s key with error.
Sourcepub fn iter(&self) -> impl Iterator<Item = &FieldError<K>>
pub fn iter(&self) -> impl Iterator<Item = &FieldError<K>>
Every error, in the order it was added.
Source§impl FieldErrors
impl FieldErrors
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Whether any error renders under key.
Sourcepub fn first(&self, key: &str) -> Option<&FieldError>
pub fn first(&self, key: &str) -> Option<&FieldError>
The error key renders: the first one added.
Trait Implementations§
Source§impl<K: Debug> Debug for FieldErrors<K>
impl<K: Debug> Debug for FieldErrors<K>
Source§impl<K> Default for FieldErrors<K>
impl<K> Default for FieldErrors<K>
Source§impl<K> IntoIterator for FieldErrors<K>
impl<K> IntoIterator for FieldErrors<K>
Auto Trait Implementations§
impl<K> Freeze for FieldErrors<K>
impl<K> RefUnwindSafe for FieldErrors<K>
impl<K> Send for FieldErrors<K>
impl<K> Sync for FieldErrors<K>
impl<K> Unpin for FieldErrors<K>
impl<K> UnsafeUnpin for FieldErrors<K>
impl<K> UnwindSafe for FieldErrors<K>
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