annotated 0.2.0

Validation for structs that works with serde: every broken rule and missing field in one error
Documentation
use annotated::Validate;

#[derive(Validate)]
struct Address {
    #[validate(required)]
    street: String,
}

#[derive(Validate)]
struct Order {
    #[validate(nested(message = "must be a valid address"))]
    shipping_address: Address,
}

#[derive(Validate)]
struct Invoice {
    #[validate(nested = true)]
    billing_address: Address,
}

#[derive(Validate)]
struct Parcel {
    #[validate(nested(depth = 2))]
    return_address: Address,
}

fn main() {}