Trait nyar_error::Validate

source ·
pub trait Validate<T, E> {
    // Required methods
    fn valid(self) -> Validation<T, E>;
    fn validate(self, errors: &mut Vec<E>) -> Validation<T, E>
       where E: Clone;
    fn recover(self, errors: &mut Vec<E>) -> Validation<T, E>
       where T: Default;
}

Required Methods§

source

fn valid(self) -> Validation<T, E>

source

fn validate(self, errors: &mut Vec<E>) -> Validation<T, E>
where E: Clone,

source

fn recover(self, errors: &mut Vec<E>) -> Validation<T, E>
where T: Default,

Implementations on Foreign Types§

source§

impl<T, E> Validate<T, E> for Option<T>
where E: From<()>,

source§

fn valid(self) -> Validation<T, E>

source§

fn validate(self, errors: &mut Vec<E>) -> Validation<T, E>
where E: Clone,

source§

fn recover(self, errors: &mut Vec<E>) -> Validation<T, E>
where T: Default,

source§

impl<T, E, F> Validate<T, E> for Result<T, F>
where E: From<F>,

source§

fn valid(self) -> Validation<T, E>

source§

fn validate(self, errors: &mut Vec<E>) -> Validation<T, E>
where E: Clone,

source§

fn recover(self, errors: &mut Vec<E>) -> Validation<T, E>
where T: Default,

Implementors§

source§

impl<T, E, F> Validate<T, E> for Validation<T, F>
where E: From<F>,