Struct jsonschema_valid_compat::ValidationError[][src]

pub struct ValidationError {
    pub msg: String,
    pub instance: Option<Value>,
    pub schema: Option<Value>,
    pub instance_path: Vec<String>,
    pub schema_path: Vec<String>,
}

An error that can occur during validation.

Fields

msg: String

The error message.

instance: Option<Value>

The JSON instance fragment that had the issue.

schema: Option<Value>

The JSON schema fragment that had the issue.

instance_path: Vec<String>

The path to the JSON instance fragment within the entire instance document.

schema_path: Vec<String>

The path to the JSON schema fragment within the entire schema.

Implementations

impl ValidationError[src]

Stores information about a single validation error.

pub fn new(
    msg: &str,
    instance: Option<&Value>,
    schema: Option<&Value>
) -> ValidationError
[src]

Create a new validation error with the given error message.

pub fn add_ctx(self, instance_context: String, schema_context: String) -> Self[src]

Update the instance and schema context for the error.

pub fn instance_ctx(self, instance_context: String) -> Self[src]

Update the instance context for the error.

pub fn schema_ctx(self, schema_context: String) -> Self[src]

Update the schema context for the error.

Trait Implementations

impl Clone for ValidationError[src]

impl Debug for ValidationError[src]

impl Default for ValidationError[src]

impl Display for ValidationError[src]

impl Error for ValidationError[src]

impl From<ParseError> for ValidationError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.