#[non_exhaustive]pub struct ValidationErrors { /* private fields */ }Expand description
A non-empty list of every ValidationError found in one document.
Errors appear in a stable order: size or syntax (each reported alone), then schema_version, then
unknown keys in document order, then field errors in schema order, then
cross-field conflicts. Serialises as a JSON array of errors.
Implementations§
Source§impl ValidationErrors
impl ValidationErrors
Sourcepub fn as_slice(&self) -> &[ValidationError]
pub fn as_slice(&self) -> &[ValidationError]
Returns the errors as a slice.
Sourcepub fn iter(&self) -> Iter<'_, ValidationError> ⓘ
pub fn iter(&self) -> Iter<'_, ValidationError> ⓘ
Iterates over the errors in report order.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns false: a ValidationErrors always holds at least one error.
Sourcepub fn into_vec(self) -> Vec<ValidationError>
pub fn into_vec(self) -> Vec<ValidationError>
Consumes the list and returns the errors.
Trait Implementations§
Source§impl Clone for ValidationErrors
impl Clone for ValidationErrors
Source§impl Debug for ValidationErrors
impl Debug for ValidationErrors
Source§impl Display for ValidationErrors
impl Display for ValidationErrors
impl Eq for ValidationErrors
Source§impl Error for ValidationErrors
impl Error for ValidationErrors
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 Hash for ValidationErrors
impl Hash for ValidationErrors
Source§impl<'a> IntoIterator for &'a ValidationErrors
impl<'a> IntoIterator for &'a ValidationErrors
Source§impl IntoIterator for ValidationErrors
impl IntoIterator for ValidationErrors
Source§impl PartialEq for ValidationErrors
impl PartialEq for ValidationErrors
Source§impl Serialize for ValidationErrors
impl Serialize for ValidationErrors
impl StructuralPartialEq for ValidationErrors
Auto Trait Implementations§
impl Forget for ValidationErrors
impl Freeze for ValidationErrors
impl Move for ValidationErrors
impl RefUnwindSafe for ValidationErrors
impl Send for ValidationErrorswhere
RawVecInner: Send,
impl Sync for ValidationErrorswhere
RawVecInner: Sync,
impl Unpin for ValidationErrors
impl UnsafeUnpin for ValidationErrors
impl UnwindSafe for ValidationErrorswhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.