Trait irox_time::Range

source ·
pub trait Range<T>where
    T: Debug + Display + Clone + PartialOrd,{
    type Error;

    // Required methods
    fn value_is_valid(&self, value: &T) -> bool;
    fn check_value_is_valid(&self, value: &T) -> Result<(), Self::Error>;
}
Expand description

A trait to check if a particular value is within range

Required Associated Types§

Required Methods§

source

fn value_is_valid(&self, value: &T) -> bool

Returns true if the value is valid for the specified range

source

fn check_value_is_valid(&self, value: &T) -> Result<(), Self::Error>

Checks if the value is valid, if valid, returns Ok(()) If not valid, returns Err(Error)

Implementors§