Trait exar::Validation [] [src]

pub trait Validation where Self: Sized {
    fn validate(&self) -> Result<()ValidationError>;

    fn validated(self) -> Result<Self, ValidationError> { ... }
}

A trait for validating a type.

Required Methods

fn validate(&self) -> Result<()ValidationError>

Validates the type or returns a ValidationError if validation fails.

Provided Methods

fn validated(self) -> Result<Self, ValidationError>

Validates and returns Self or a ValidationError if validation fails.

Implementors