validators 0.25.3

This library is designed for validating and modeling user input. The crate includes models, functions, traits, errors, and other dependencies.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Validate and deserialize (floating) numbers.
pub trait ValidateNumber: Sized {
    type Error;

    fn parse_f64(f: f64) -> Result<Self, Self::Error>;

    fn validate_f64(f: f64) -> Result<(), Self::Error>;

    #[inline]
    fn parse_f32(f: f32) -> Result<Self, Self::Error> {
        Self::parse_f64(f as f64)
    }

    #[inline]
    fn validate_f32(f: f32) -> Result<(), Self::Error> {
        Self::validate_f64(f as f64)
    }
}