irox_units::bounds

Trait 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§