[][src]Struct jddf::validator::ValidationError

pub struct ValidationError<'a> { /* fields omitted */ }

Contains a single problem with an instance when evaluated against a schema.

Note that, despite its name, ValidationError is not an error in the usual Rust sense. It is an ordinary struct, which happens to contain information about why some data was unsatisfactory against a given schema.

ValidationError uses Cow instead of String to store its components. That's because this crate makes every effort to never copy data out of your instances. However, some parts of error paths require allocation (such as when the usize indices of an array are converted into String), and so Cow is used.

Methods

impl<'a> ValidationError<'a>[src]

pub fn new(
    instance_path: JsonPointer<Cow<'a, str>, Vec<Cow<'a, str>>>,
    schema_path: JsonPointer<Cow<'a, str>, Vec<Cow<'a, str>>>
) -> ValidationError<'a>
[src]

pub fn instance_path(&self) -> &JsonPointer<Cow<'a, str>, Vec<Cow<'a, str>>>[src]

A pointer into the part of the instance (input) which was rejected.

pub fn schema_path(&self) -> &JsonPointer<Cow<'a, str>, Vec<Cow<'a, str>>>[src]

A pointer into the part of the schema which rejected the instance.

Trait Implementations

impl<'a> Clone for ValidationError<'a>[src]

impl<'a> Debug for ValidationError<'a>[src]

impl<'a> Eq for ValidationError<'a>[src]

impl<'a> PartialEq<ValidationError<'a>> for ValidationError<'a>[src]

impl<'a> StructuralEq for ValidationError<'a>[src]

impl<'a> StructuralPartialEq for ValidationError<'a>[src]

Auto Trait Implementations

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> UnwindSafe for ValidationError<'a>

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, 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.