Enum validatron::error::Error[][src]

pub enum Error {
    Unstructured(Vec<Cow<'static, str>>),
    Structured(HashMap<Location, Error>),

A type that represents all validation issues that arise during the validation of the given data type.


Unstructured(Vec<Cow<'static, str>>)

A flat, unstructured list of failure reasons

Structured(HashMap<Location, Error>)

A structured, potentially nested set of failure reasons

a vector or a nested map can attribute errors to the correct locations


impl Error[src]

pub fn new<S>(message: S) -> Self where
    S: Into<Cow<'static, str>>, 

Constructs a new unstructured Error with a single message

let e = Error::new("the universe divided by 0");

pub fn merge(&mut self, other: Error)[src]

Merge 2 existing Error types

let mut e1 = Error::new("the universe divided by 0");
let e2 = Error::new("an unstoppable force collided with an improvable object");


pub fn build() -> ErrorBuilder[src]

create a new ErrorBuilder instance

Trait Implementations

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl PartialEq<Error> for Error[src]

impl Serialize for Error[src]

impl StructuralPartialEq for Error[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.