Skip to main content

Binary

Trait Binary 

Source
pub unsafe trait Binary<T>: Results<T, 2> + Sync {
    // Required methods
    fn one(&self, x: T, y: T) -> Self::Out;
    fn judged(&self, x: T, y: T) -> (Self::Out, bool);
    fn slice(
        &self,
        args: [Arg<'_, T>; 2],
        n: usize,
        out: &mut [MaybeUninit<Self::Out>],
    ) -> bool;

    // Provided methods
    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
       where T: Copy + Sync { ... }
    fn many_into(
        &self,
        x: Arg<'_, T>,
        y: Arg<'_, T>,
        n: usize,
        out: &mut Slots<'_, Self::Out>,
    ) -> bool
       where T: Copy { ... }
}
Expand description

A function of two items as a value, as Unary is for one.

§Safety

The slice body initializes every slot in its output before returning.

Required Methods§

Source

fn one(&self, x: T, y: T) -> Self::Out

Source

fn judged(&self, x: T, y: T) -> (Self::Out, bool)

Source

fn slice( &self, args: [Arg<'_, T>; 2], n: usize, out: &mut [MaybeUninit<Self::Out>], ) -> bool

Provided Methods§

Source

fn checked(&self, x: T, y: T) -> Option<Self::Out>

Source

fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
where T: Copy + Sync,

Source

fn many_into( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Slots<'_, Self::Out>, ) -> bool
where T: Copy,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Binary<Complex<f32>> for Equal

Source§

impl Binary<Complex<f32>> for Gcd

Source§

impl Binary<Complex<f32>> for Lcm

Source§

impl Binary<Complex<f32>> for NotEqual

Source§

impl Binary<Complex<f32>> for Residue

Source§

impl Binary<Complex<f64>> for Equal

Source§

impl Binary<Complex<f64>> for Gcd

Source§

impl Binary<Complex<f64>> for Lcm

Source§

impl Binary<Complex<f64>> for NotEqual

Source§

impl Binary<Complex<f64>> for Residue

Source§

impl Binary<bool> for Gcd

Source§

impl Binary<bool> for Lcm

Source§

impl Binary<bool> for Maximum

Source§

impl Binary<bool> for Minimum

Source§

impl Binary<bool> for Xnor

Source§

impl Binary<bool> for Xor

Source§

impl Binary<f16> for Compare

Source§

impl Binary<f16> for Equal

Source§

impl Binary<f16> for Gcd

Source§

impl Binary<f16> for Greater

Source§

impl Binary<f16> for GreaterEqual

Source§

impl Binary<f16> for Lcm

Source§

impl Binary<f16> for Less

Source§

impl Binary<f16> for LessEqual

Source§

impl Binary<f16> for Matches

Source§

impl Binary<f16> for Maximum

Source§

impl Binary<f16> for Minimum

Source§

impl Binary<f16> for NotEqual

Source§

impl Binary<f16> for Residue

Source§

impl Binary<f32> for Compare

Source§

impl Binary<f32> for Equal

Source§

impl Binary<f32> for Gcd

Source§

impl Binary<f32> for Greater

Source§

impl Binary<f32> for GreaterEqual

Source§

impl Binary<f32> for Indicator<Equal>

Source§

impl Binary<f32> for Indicator<Greater>

Source§

impl Binary<f32> for Indicator<GreaterEqual>

Source§

impl Binary<f32> for Indicator<Less>

Source§

impl Binary<f32> for Indicator<LessEqual>

Source§

impl Binary<f32> for Indicator<Matches>

Source§

impl Binary<f32> for Indicator<NotEqual>

Source§

impl Binary<f32> for Lcm

Source§

impl Binary<f32> for Less

Source§

impl Binary<f32> for LessEqual

Source§

impl Binary<f32> for Matches

Source§

impl Binary<f32> for Maximum

Source§

impl Binary<f32> for Minimum

Source§

impl Binary<f32> for NotEqual

Source§

impl Binary<f32> for Residue

Source§

impl Binary<f64> for Compare

Source§

impl Binary<f64> for Equal

Source§

impl Binary<f64> for Gcd

Source§

impl Binary<f64> for Greater

Source§

impl Binary<f64> for GreaterEqual

Source§

impl Binary<f64> for Indicator<Equal>

Source§

impl Binary<f64> for Indicator<Greater>

Source§

impl Binary<f64> for Indicator<GreaterEqual>

Source§

impl Binary<f64> for Indicator<Less>

Source§

impl Binary<f64> for Indicator<LessEqual>

Source§

impl Binary<f64> for Indicator<Matches>

Source§

impl Binary<f64> for Indicator<NotEqual>

Source§

impl Binary<f64> for Lcm

Source§

impl Binary<f64> for Less

Source§

impl Binary<f64> for LessEqual

Source§

impl Binary<f64> for Matches

Source§

impl Binary<f64> for Maximum

Source§

impl Binary<f64> for Minimum

Source§

impl Binary<f64> for NotEqual

Source§

impl Binary<f64> for Residue

Source§

impl Binary<i16> for Binom

Source§

impl Binary<i16> for Gcd

Source§

impl Binary<i16> for Lcm

Source§

impl Binary<i16> for Maximum

Source§

impl Binary<i16> for Minimum

Source§

impl Binary<i16> for Pow

Source§

impl Binary<i16> for Residue

Source§

impl Binary<i32> for Binom

Source§

impl Binary<i32> for Gcd

Source§

impl Binary<i32> for Lcm

Source§

impl Binary<i32> for Maximum

Source§

impl Binary<i32> for Minimum

Source§

impl Binary<i32> for Pow

Source§

impl Binary<i32> for Residue

Source§

impl Binary<i64> for Binom

Source§

impl Binary<i64> for Gcd

Source§

impl Binary<i64> for Lcm

Source§

impl Binary<i64> for Maximum

Source§

impl Binary<i64> for Minimum

Source§

impl Binary<i64> for Pow

Source§

impl Binary<i64> for Residue

Source§

impl Binary<u8> for Binom

Source§

impl Binary<u8> for Gcd

Source§

impl Binary<u8> for Lcm

Source§

impl Binary<u8> for Maximum

Source§

impl Binary<u8> for Minimum

Source§

impl Binary<u8> for Pow

Source§

impl Binary<u8> for Residue

Source§

impl<T, K> Binary<T> for Flipped<K>
where K: Binary<T>,

Source§

impl<T, K> Binary<T> for Wrapped<K>
where T: KernelItem, K: Binary<T>,