[−][src]Trait vek::ops::IsBetween
A value that can tell whether or not it is between two bounds (inclusive).
Associated Types
Loading content...Required methods
pub fn is_between(self, lower: Bound, upper: Bound) -> Self::Output
[src]
Returns whether this value is between lower
and upper
(inclusive).
This would rather make use of inclusive ranges, but it's an unstable feature.
Panics
Panics if lower
is greater than upper
. Swap the values yourself if necessary.
use vek::ops::IsBetween; assert!(5_i32 .is_between(5, 10)); assert!(7_i32 .is_between(5, 10)); assert!(10_i32.is_between(5, 10)); assert!(!(4_i32 .is_between(5, 10))); assert!(!(11_i32.is_between(5, 10)));
Provided methods
pub fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
Bound: Zero + One,
Returns whether this value is between 0 and 1 (inclusive).