[][src]Crate validatron

A data structure validation library

use validatron::Validate;

#[derive(Debug, Validate)]
struct MyStruct {
    #[validatron(min = 42)]
    a: i64,
    #[validatron(equal = "hello world!")]
    b: String,
}

let x = MyStruct {
    a: 36,
    b: "hello world!".into()
};

x.validate().is_err();

Re-exports

pub use error::Error;
pub use error::Location;

Modules

error

An Error type for representing validation failures

validators

pre-rolled validators for data structures

Traits

Validate

The core Validatron trait, types that implement this trait can be exhaustively validated.

Type Definitions

Result

A convenience type for Results using the Error error type.

Derive Macros

Validate

A derive macro for validating data structures