pub struct Indicator<K>(pub K);Expand description
A comparison’s results as floats, 1 where it holds and 0 where it doesn’t, as a Binary at f32 and f64 for each comparison here. A caller that computes in floats reads a comparison’s results this way, rather than storing Booleans and converting them. Its slice form compares each item and writes its float in one loop.
Tuple Fields§
§0: KTrait Implementations§
Source§impl Binary<f32> for Indicator<Equal>
impl Binary<f32> for Indicator<Equal>
fn one(&self, x: f32, y: f32) -> f32
fn judged(&self, x: f32, y: f32) -> (f32, bool)
fn slice( &self, [x, y]: [Arg<'_, f32>; 2], n: usize, out: &mut [MaybeUninit<f32>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f32> for Indicator<NotEqual>
impl Binary<f32> for Indicator<NotEqual>
fn one(&self, x: f32, y: f32) -> f32
fn judged(&self, x: f32, y: f32) -> (f32, bool)
fn slice( &self, [x, y]: [Arg<'_, f32>; 2], n: usize, out: &mut [MaybeUninit<f32>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f32> for Indicator<Less>
impl Binary<f32> for Indicator<Less>
fn one(&self, x: f32, y: f32) -> f32
fn judged(&self, x: f32, y: f32) -> (f32, bool)
fn slice( &self, [x, y]: [Arg<'_, f32>; 2], n: usize, out: &mut [MaybeUninit<f32>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f32> for Indicator<LessEqual>
impl Binary<f32> for Indicator<LessEqual>
fn one(&self, x: f32, y: f32) -> f32
fn judged(&self, x: f32, y: f32) -> (f32, bool)
fn slice( &self, [x, y]: [Arg<'_, f32>; 2], n: usize, out: &mut [MaybeUninit<f32>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f32> for Indicator<Greater>
impl Binary<f32> for Indicator<Greater>
fn one(&self, x: f32, y: f32) -> f32
fn judged(&self, x: f32, y: f32) -> (f32, bool)
fn slice( &self, [x, y]: [Arg<'_, f32>; 2], n: usize, out: &mut [MaybeUninit<f32>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f32> for Indicator<GreaterEqual>
impl Binary<f32> for Indicator<GreaterEqual>
fn one(&self, x: f32, y: f32) -> f32
fn judged(&self, x: f32, y: f32) -> (f32, bool)
fn slice( &self, [x, y]: [Arg<'_, f32>; 2], n: usize, out: &mut [MaybeUninit<f32>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f32> for Indicator<Matches>
impl Binary<f32> for Indicator<Matches>
fn one(&self, x: f32, y: f32) -> f32
fn judged(&self, x: f32, y: f32) -> (f32, bool)
fn slice( &self, [x, y]: [Arg<'_, f32>; 2], n: usize, out: &mut [MaybeUninit<f32>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f64> for Indicator<Equal>
impl Binary<f64> for Indicator<Equal>
fn one(&self, x: f64, y: f64) -> f64
fn judged(&self, x: f64, y: f64) -> (f64, bool)
fn slice( &self, [x, y]: [Arg<'_, f64>; 2], n: usize, out: &mut [MaybeUninit<f64>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f64> for Indicator<NotEqual>
impl Binary<f64> for Indicator<NotEqual>
fn one(&self, x: f64, y: f64) -> f64
fn judged(&self, x: f64, y: f64) -> (f64, bool)
fn slice( &self, [x, y]: [Arg<'_, f64>; 2], n: usize, out: &mut [MaybeUninit<f64>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f64> for Indicator<Less>
impl Binary<f64> for Indicator<Less>
fn one(&self, x: f64, y: f64) -> f64
fn judged(&self, x: f64, y: f64) -> (f64, bool)
fn slice( &self, [x, y]: [Arg<'_, f64>; 2], n: usize, out: &mut [MaybeUninit<f64>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f64> for Indicator<LessEqual>
impl Binary<f64> for Indicator<LessEqual>
fn one(&self, x: f64, y: f64) -> f64
fn judged(&self, x: f64, y: f64) -> (f64, bool)
fn slice( &self, [x, y]: [Arg<'_, f64>; 2], n: usize, out: &mut [MaybeUninit<f64>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f64> for Indicator<Greater>
impl Binary<f64> for Indicator<Greater>
fn one(&self, x: f64, y: f64) -> f64
fn judged(&self, x: f64, y: f64) -> (f64, bool)
fn slice( &self, [x, y]: [Arg<'_, f64>; 2], n: usize, out: &mut [MaybeUninit<f64>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f64> for Indicator<GreaterEqual>
impl Binary<f64> for Indicator<GreaterEqual>
fn one(&self, x: f64, y: f64) -> f64
fn judged(&self, x: f64, y: f64) -> (f64, bool)
fn slice( &self, [x, y]: [Arg<'_, f64>; 2], n: usize, out: &mut [MaybeUninit<f64>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl Binary<f64> for Indicator<Matches>
impl Binary<f64> for Indicator<Matches>
fn one(&self, x: f64, y: f64) -> f64
fn judged(&self, x: f64, y: f64) -> (f64, bool)
fn slice( &self, [x, y]: [Arg<'_, f64>; 2], n: usize, out: &mut [MaybeUninit<f64>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
impl<K: Copy> Copy for Indicator<K>
Auto Trait Implementations§
impl<K> Forget for Indicator<K>
impl<K> Freeze for Indicator<K>where
K: Freeze,
impl<K> RefUnwindSafe for Indicator<K>where
K: RefUnwindSafe,
impl<K> Send for Indicator<K>where
K: Send,
impl<K> Sync for Indicator<K>where
K: Sync,
impl<K> Unpin for Indicator<K>where
K: Unpin,
impl<K> UnsafeUnpin for Indicator<K>where
K: UnsafeUnpin,
impl<K> UnwindSafe for Indicator<K>where
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more