Trait vek::ops::IsBetween [−][src]
pub trait IsBetween<Bound = Self>: Sized { type Output; fn is_between(self, lower: Bound, upper: Bound) -> Self::Output; fn is_between01(self) -> Self::Output
where
Bound: Zero + One, { ... } }
Expand description
A value that can tell whether or not it is between two bounds (inclusive).
Associated Types
Loading content...Required methods
fn is_between(self, lower: Bound, upper: Bound) -> Self::Output
[src]
Expand description
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
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
Bound: Zero + One,
Expand description
Returns whether this value is between 0 and 1 (inclusive).
Implementations on Foreign Types
Loading content...Implementors
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for vek::vec::repr_c::extent2::Extent2<T>
[src]
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for vek::vec::repr_c::extent2::Extent2<T>
[src]impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for vek::vec::repr_c::extent3::Extent3<T>
[src]
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for vek::vec::repr_c::extent3::Extent3<T>
[src]impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for vek::vec::repr_simd::extent2::Extent2<T>
[src]
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for vek::vec::repr_simd::extent2::Extent2<T>
[src]impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for vek::vec::repr_simd::extent3::Extent3<T>
[src]
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for vek::vec::repr_simd::extent3::Extent3<T>
[src]impl<T: IsBetween<Output = bool>> IsBetween<Extent2<T>> for vek::vec::repr_c::extent2::Extent2<T>
[src]
impl<T: IsBetween<Output = bool>> IsBetween<Extent2<T>> for vek::vec::repr_c::extent2::Extent2<T>
[src]impl<T: IsBetween<Output = bool>> IsBetween<Extent3<T>> for vek::vec::repr_c::extent3::Extent3<T>
[src]
impl<T: IsBetween<Output = bool>> IsBetween<Extent3<T>> for vek::vec::repr_c::extent3::Extent3<T>
[src]impl<T: IsBetween<Output = bool>> IsBetween<Extent2<T>> for vek::vec::repr_simd::extent2::Extent2<T>
[src]
impl<T: IsBetween<Output = bool>> IsBetween<Extent2<T>> for vek::vec::repr_simd::extent2::Extent2<T>
[src]impl<T: IsBetween<Output = bool>> IsBetween<Extent3<T>> for vek::vec::repr_simd::extent3::Extent3<T>
[src]
impl<T: IsBetween<Output = bool>> IsBetween<Extent3<T>> for vek::vec::repr_simd::extent3::Extent3<T>
[src]