Skip to main content

ValidationErrorKind

Enum ValidationErrorKind 

Source
pub enum ValidationErrorKind {
Show 35 variants AdditionalItems { limit: usize, }, AdditionalProperty { property: String, }, AnyOf, BacktrackLimitExceeded { message: String, }, Constant { expected_value: Value, }, Contains, ContentEncoding { content_encoding: String, }, ContentMediaType { content_media_type: String, }, Custom { keyword: String, message: String, }, Enum { options: Value, }, ExclusiveMaximum { limit: Value, }, ExclusiveMinimum { limit: Value, }, FalseSchema, Format { format: String, }, FromUtf8 { message: String, }, MaxItems { limit: u64, }, Maximum { limit: Value, }, MaxLength { limit: u64, }, MaxProperties { limit: u64, }, MinItems { limit: u64, }, Minimum { limit: Value, }, MinLength { limit: u64, }, MinProperties { limit: u64, }, MultipleOf { multiple_of: f64, }, Not, OneOfMultipleValid, OneOfNotValid, Pattern { pattern: String, }, PropertyNames { message: String, }, Required { property: String, }, Type { expected: String, }, UnevaluatedItems { unexpected: Vec<String>, }, UnevaluatedProperties { unexpected: Vec<String>, }, UniqueItems, Referencing { message: String, },
}
Expand description

Typed validation error kinds mirroring jsonschema::ValidationErrorKind.

Non-serializable nested errors (e.g. AnyOf, OneOf* context) drop their sub-error context. Non-serializable error types store a message: String.

Variants§

§

AdditionalItems

Fields

§limit: usize
§

AdditionalProperty

A single unexpected property — split from AdditionalProperties (plural).

Fields

§property: String
§

AnyOf

§

BacktrackLimitExceeded

Fields

§message: String
§

Constant

Fields

§expected_value: Value
§

Contains

§

ContentEncoding

Fields

§content_encoding: String
§

ContentMediaType

Fields

§content_media_type: String
§

Custom

Fields

§keyword: String
§message: String
§

Enum

Fields

§options: Value
§

ExclusiveMaximum

Fields

§limit: Value
§

ExclusiveMinimum

Fields

§limit: Value
§

FalseSchema

§

Format

Fields

§format: String
§

FromUtf8

Fields

§message: String
§

MaxItems

Fields

§limit: u64
§

Maximum

Fields

§limit: Value
§

MaxLength

Fields

§limit: u64
§

MaxProperties

Fields

§limit: u64
§

MinItems

Fields

§limit: u64
§

Minimum

Fields

§limit: Value
§

MinLength

Fields

§limit: u64
§

MinProperties

Fields

§limit: u64
§

MultipleOf

Fields

§multiple_of: f64
§

Not

§

OneOfMultipleValid

§

OneOfNotValid

§

Pattern

Fields

§pattern: String
§

PropertyNames

Fields

§message: String
§

Required

Fields

§property: String
§

Type

Fields

§expected: String
§

UnevaluatedItems

Fields

§unexpected: Vec<String>
§

UnevaluatedProperties

Fields

§unexpected: Vec<String>
§

UniqueItems

§

Referencing

Fields

§message: String

Implementations§

Source§

impl ValidationErrorKind

Source

pub fn message(&self) -> String

Produce a human-readable error message from the structured fields.

Trait Implementations§

Source§

impl AsRef<str> for ValidationErrorKind

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for ValidationErrorKind

Source§

fn clone(&self) -> ValidationErrorKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ValidationErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ValidationErrorKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ValidationErrorKind

Source§

fn eq(&self, other: &ValidationErrorKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ValidationErrorKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ValidationErrorKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,