Trait range_check::Within
[−]
[src]
pub trait Within<R, RRef: Borrow<R>>: Sized { fn is_within(&self, range: RRef) -> bool; }
A trait for values that could be contained in a range.
Required Methods
fn is_within(&self, range: RRef) -> bool
Returns true
if this value is contained within the given range;
false
otherwise.
Supports both values and references as the range argument.
Examples
use range_check::Within; assert!(4123.is_within(3000..5000));