validator 0.20.0

Common validation functions (email, url, length, ...) and trait - to be used with `validator_derive`
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Validates whether the given Option is Some
pub trait ValidateRequired {
    fn validate_required(&self) -> bool {
        self.is_some()
    }

    fn is_some(&self) -> bool;
}

impl<T> ValidateRequired for Option<T> {
    fn is_some(&self) -> bool {
        self.is_some()
    }
}