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, { ... } }
A value that can tell whether or not it is between two bounds (inclusive).
Associated Types
type Output
bool
for scalars, or vector of bool
s for vectors.
Required Methods
fn is_between(self, lower: Bound, upper: Bound) -> Self::Output
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,
Bound: Zero + One,
Returns whether this value is between 0 and 1 (inclusive).
Implementations on Foreign Types
impl IsBetween for f32
[src]
impl IsBetween for f32
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for f64
[src]
impl IsBetween for f64
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for i8
[src]
impl IsBetween for i8
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for i16
[src]
impl IsBetween for i16
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for i32
[src]
impl IsBetween for i32
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for i64
[src]
impl IsBetween for i64
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for isize
[src]
impl IsBetween for isize
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for u8
[src]
impl IsBetween for u8
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for u16
[src]
impl IsBetween for u16
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for u32
[src]
impl IsBetween for u32
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for u64
[src]
impl IsBetween for u64
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for usize
[src]
impl IsBetween for usize
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<i8>
[src]
impl IsBetween for Wrapping<i8>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<i16>
[src]
impl IsBetween for Wrapping<i16>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<i32>
[src]
impl IsBetween for Wrapping<i32>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<i64>
[src]
impl IsBetween for Wrapping<i64>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<isize>
[src]
impl IsBetween for Wrapping<isize>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<u8>
[src]
impl IsBetween for Wrapping<u8>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<u16>
[src]
impl IsBetween for Wrapping<u16>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<u32>
[src]
impl IsBetween for Wrapping<u32>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<u64>
[src]
impl IsBetween for Wrapping<u64>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
impl IsBetween for Wrapping<usize>
[src]
impl IsBetween for Wrapping<usize>
type Output = bool
fn is_between(self, lower: Self, upper: Self) -> bool
[src]
fn is_between(self, lower: Self, upper: Self) -> bool
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
[src]
fn is_between01(self) -> Self::Output where
Bound: Zero + One,
Implementors
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for Vec2<T> type Output = Vec2<bool>;
impl<T: IsBetween<Output = bool>> IsBetween<Vec2<T>> for Vec2<T> type Output = Vec2<bool>;
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for Vec3<T> type Output = Vec3<bool>;
impl<T: IsBetween<Output = bool>> IsBetween<Vec3<T>> for Vec3<T> type Output = Vec3<bool>;
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for Vec4<T> type Output = Vec4<bool>;
impl<T: IsBetween<Output = bool>> IsBetween<Vec4<T>> for Vec4<T> type Output = Vec4<bool>;
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for Extent3<T> type Output = Extent3<bool>;
impl<T: IsBetween<Output = bool>> IsBetween<Extent3<T>> for Extent3<T> type Output = Extent3<bool>;
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for Extent2<T> type Output = Extent2<bool>;
impl<T: IsBetween<Output = bool>> IsBetween<Extent2<T>> for Extent2<T> type Output = Extent2<bool>;
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for Rgba<T> type Output = Rgba<bool>;
impl<T: IsBetween<Output = bool>> IsBetween<Rgba<T>> for Rgba<T> type Output = Rgba<bool>;
impl<T: IsBetween<Output = bool> + Copy> IsBetween<T> for Rgb<T> type Output = Rgb<bool>;
impl<T: IsBetween<Output = bool>> IsBetween<Rgb<T>> for Rgb<T> type Output = Rgb<bool>;