validator

Trait ValidateRange

Source
pub trait ValidateRange<T> {
    // Required methods
    fn greater_than(&self, max: T) -> Option<bool>;
    fn less_than(&self, min: T) -> Option<bool>;

    // Provided method
    fn validate_range(
        &self,
        min: Option<T>,
        max: Option<T>,
        exclusive_min: Option<T>,
        exclusive_max: Option<T>,
    ) -> bool { ... }
}
Expand description

Validates that the given value is inside the defined range. The max, min, exclusive_max and exclusive_min parameters are optional and will only be validated if they are not None

Required Methods§

Source

fn greater_than(&self, max: T) -> Option<bool>

Source

fn less_than(&self, min: T) -> Option<bool>

Provided Methods§

Source

fn validate_range( &self, min: Option<T>, max: Option<T>, exclusive_min: Option<T>, exclusive_max: Option<T>, ) -> bool

Implementations on Foreign Types§

Source§

impl ValidateRange<f32> for Option<Option<f32>>

Source§

fn greater_than(&self, max: f32) -> Option<bool>

Source§

fn less_than(&self, min: f32) -> Option<bool>

Source§

impl ValidateRange<f32> for Option<f32>

Source§

fn greater_than(&self, max: f32) -> Option<bool>

Source§

fn less_than(&self, min: f32) -> Option<bool>

Source§

impl ValidateRange<f32> for f32

Source§

fn greater_than(&self, max: f32) -> Option<bool>

Source§

fn less_than(&self, min: f32) -> Option<bool>

Source§

impl ValidateRange<f64> for Option<Option<f64>>

Source§

fn greater_than(&self, max: f64) -> Option<bool>

Source§

fn less_than(&self, min: f64) -> Option<bool>

Source§

impl ValidateRange<f64> for Option<f64>

Source§

fn greater_than(&self, max: f64) -> Option<bool>

Source§

fn less_than(&self, min: f64) -> Option<bool>

Source§

impl ValidateRange<f64> for f64

Source§

fn greater_than(&self, max: f64) -> Option<bool>

Source§

fn less_than(&self, min: f64) -> Option<bool>

Source§

impl ValidateRange<i8> for Option<Option<i8>>

Source§

fn greater_than(&self, max: i8) -> Option<bool>

Source§

fn less_than(&self, min: i8) -> Option<bool>

Source§

impl ValidateRange<i8> for Option<i8>

Source§

fn greater_than(&self, max: i8) -> Option<bool>

Source§

fn less_than(&self, min: i8) -> Option<bool>

Source§

impl ValidateRange<i8> for i8

Source§

fn greater_than(&self, max: i8) -> Option<bool>

Source§

fn less_than(&self, min: i8) -> Option<bool>

Source§

impl ValidateRange<i16> for Option<Option<i16>>

Source§

fn greater_than(&self, max: i16) -> Option<bool>

Source§

fn less_than(&self, min: i16) -> Option<bool>

Source§

impl ValidateRange<i16> for Option<i16>

Source§

fn greater_than(&self, max: i16) -> Option<bool>

Source§

fn less_than(&self, min: i16) -> Option<bool>

Source§

impl ValidateRange<i16> for i16

Source§

fn greater_than(&self, max: i16) -> Option<bool>

Source§

fn less_than(&self, min: i16) -> Option<bool>

Source§

impl ValidateRange<i32> for Option<Option<i32>>

Source§

fn greater_than(&self, max: i32) -> Option<bool>

Source§

fn less_than(&self, min: i32) -> Option<bool>

Source§

impl ValidateRange<i32> for Option<i32>

Source§

fn greater_than(&self, max: i32) -> Option<bool>

Source§

fn less_than(&self, min: i32) -> Option<bool>

Source§

impl ValidateRange<i32> for i32

Source§

fn greater_than(&self, max: i32) -> Option<bool>

Source§

fn less_than(&self, min: i32) -> Option<bool>

Source§

impl ValidateRange<i64> for Option<Option<i64>>

Source§

fn greater_than(&self, max: i64) -> Option<bool>

Source§

fn less_than(&self, min: i64) -> Option<bool>

Source§

impl ValidateRange<i64> for Option<i64>

Source§

fn greater_than(&self, max: i64) -> Option<bool>

Source§

fn less_than(&self, min: i64) -> Option<bool>

Source§

impl ValidateRange<i64> for i64

Source§

fn greater_than(&self, max: i64) -> Option<bool>

Source§

fn less_than(&self, min: i64) -> Option<bool>

Source§

impl ValidateRange<i128> for Option<Option<i128>>

Source§

fn greater_than(&self, max: i128) -> Option<bool>

Source§

fn less_than(&self, min: i128) -> Option<bool>

Source§

impl ValidateRange<i128> for Option<i128>

Source§

fn greater_than(&self, max: i128) -> Option<bool>

Source§

fn less_than(&self, min: i128) -> Option<bool>

Source§

impl ValidateRange<i128> for i128

Source§

fn greater_than(&self, max: i128) -> Option<bool>

Source§

fn less_than(&self, min: i128) -> Option<bool>

Source§

impl ValidateRange<isize> for Option<Option<isize>>

Source§

fn greater_than(&self, max: isize) -> Option<bool>

Source§

fn less_than(&self, min: isize) -> Option<bool>

Source§

impl ValidateRange<isize> for Option<isize>

Source§

fn greater_than(&self, max: isize) -> Option<bool>

Source§

fn less_than(&self, min: isize) -> Option<bool>

Source§

impl ValidateRange<isize> for isize

Source§

fn greater_than(&self, max: isize) -> Option<bool>

Source§

fn less_than(&self, min: isize) -> Option<bool>

Source§

impl ValidateRange<u8> for Option<Option<u8>>

Source§

fn greater_than(&self, max: u8) -> Option<bool>

Source§

fn less_than(&self, min: u8) -> Option<bool>

Source§

impl ValidateRange<u8> for Option<u8>

Source§

fn greater_than(&self, max: u8) -> Option<bool>

Source§

fn less_than(&self, min: u8) -> Option<bool>

Source§

impl ValidateRange<u8> for u8

Source§

fn greater_than(&self, max: u8) -> Option<bool>

Source§

fn less_than(&self, min: u8) -> Option<bool>

Source§

impl ValidateRange<u16> for Option<Option<u16>>

Source§

fn greater_than(&self, max: u16) -> Option<bool>

Source§

fn less_than(&self, min: u16) -> Option<bool>

Source§

impl ValidateRange<u16> for Option<u16>

Source§

fn greater_than(&self, max: u16) -> Option<bool>

Source§

fn less_than(&self, min: u16) -> Option<bool>

Source§

impl ValidateRange<u16> for u16

Source§

fn greater_than(&self, max: u16) -> Option<bool>

Source§

fn less_than(&self, min: u16) -> Option<bool>

Source§

impl ValidateRange<u32> for Option<Option<u32>>

Source§

fn greater_than(&self, max: u32) -> Option<bool>

Source§

fn less_than(&self, min: u32) -> Option<bool>

Source§

impl ValidateRange<u32> for Option<u32>

Source§

fn greater_than(&self, max: u32) -> Option<bool>

Source§

fn less_than(&self, min: u32) -> Option<bool>

Source§

impl ValidateRange<u32> for u32

Source§

fn greater_than(&self, max: u32) -> Option<bool>

Source§

fn less_than(&self, min: u32) -> Option<bool>

Source§

impl ValidateRange<u64> for Option<Option<u64>>

Source§

fn greater_than(&self, max: u64) -> Option<bool>

Source§

fn less_than(&self, min: u64) -> Option<bool>

Source§

impl ValidateRange<u64> for Option<u64>

Source§

fn greater_than(&self, max: u64) -> Option<bool>

Source§

fn less_than(&self, min: u64) -> Option<bool>

Source§

impl ValidateRange<u64> for u64

Source§

fn greater_than(&self, max: u64) -> Option<bool>

Source§

fn less_than(&self, min: u64) -> Option<bool>

Source§

impl ValidateRange<u128> for Option<Option<u128>>

Source§

fn greater_than(&self, max: u128) -> Option<bool>

Source§

fn less_than(&self, min: u128) -> Option<bool>

Source§

impl ValidateRange<u128> for Option<u128>

Source§

fn greater_than(&self, max: u128) -> Option<bool>

Source§

fn less_than(&self, min: u128) -> Option<bool>

Source§

impl ValidateRange<u128> for u128

Source§

fn greater_than(&self, max: u128) -> Option<bool>

Source§

fn less_than(&self, min: u128) -> Option<bool>

Source§

impl ValidateRange<usize> for Option<Option<usize>>

Source§

fn greater_than(&self, max: usize) -> Option<bool>

Source§

fn less_than(&self, min: usize) -> Option<bool>

Source§

impl ValidateRange<usize> for Option<usize>

Source§

fn greater_than(&self, max: usize) -> Option<bool>

Source§

fn less_than(&self, min: usize) -> Option<bool>

Source§

impl ValidateRange<usize> for usize

Source§

fn greater_than(&self, max: usize) -> Option<bool>

Source§

fn less_than(&self, min: usize) -> Option<bool>

Source§

impl<T> ValidateRange<T> for Option<Option<T>>
where T: PartialEq + PartialOrd + ValidateRangeType,

Source§

fn greater_than(&self, max: T) -> Option<bool>

Source§

fn less_than(&self, min: T) -> Option<bool>

Source§

impl<T> ValidateRange<T> for Option<T>
where T: PartialEq + PartialOrd + ValidateRangeType,

Source§

fn greater_than(&self, max: T) -> Option<bool>

Source§

fn less_than(&self, min: T) -> Option<bool>

Implementors§

Source§

impl<T> ValidateRange<T> for T
where T: PartialEq + PartialOrd + ValidateRangeType,