Enum ValidationError
#[non_exhaustive]pub enum ValidationError<'a> {
DuplicateField(&'a FieldName),
DuplicateMember(&'a Name),
DuplicateVariant(&'a FieldName),
EmptyEnum,
NoMembers,
NotAType(&'a Name),
UnknownType(&'a Name),
}Expand description
An interface that breaks a rule of the specification.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
DuplicateField(&'a FieldName)
A field name occurs more than once in a struct.
DuplicateMember(&'a Name)
A declaration name occurs more than once in the interface.
DuplicateVariant(&'a FieldName)
A variant name occurs more than once in an enum.
EmptyEnum
An enum has no variants.
NoMembers
The interface declares nothing.
NotAType(&'a Name)
A type refers to a method or an error.
UnknownType(&'a Name)
A type refers to a name that the interface doesn’t declare.
Implementations§
§impl ValidationError<'_>
impl ValidationError<'_>
pub const fn kind(self) -> ValidationErrorKind
pub const fn kind(self) -> ValidationErrorKind
Returns the rule the error is about.
Trait Implementations§
§impl<'a> Clone for ValidationError<'a>
impl<'a> Clone for ValidationError<'a>
§fn clone(&self) -> ValidationError<'a>
fn clone(&self) -> ValidationError<'a>
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 moreimpl<'a> Copy for ValidationError<'a>
§impl<'a> Debug for ValidationError<'a>
impl<'a> Debug for ValidationError<'a>
§impl Display for ValidationError<'_>
impl Display for ValidationError<'_>
impl<'a> Eq for ValidationError<'a>
§impl Error for ValidationError<'_>
impl Error for ValidationError<'_>
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()
§impl<'a> PartialEq for ValidationError<'a>
impl<'a> PartialEq for ValidationError<'a>
impl<'a> StructuralPartialEq for ValidationError<'a>
Auto Trait Implementations§
impl<'a> Freeze for ValidationError<'a>
impl<'a> RefUnwindSafe for ValidationError<'a>
impl<'a> Send for ValidationError<'a>
impl<'a> Sync for ValidationError<'a>
impl<'a> Unpin for ValidationError<'a>
impl<'a> UnsafeUnpin for ValidationError<'a>
impl<'a> UnwindSafe for ValidationError<'a>
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