Skip to main content

Ternary

Trait Ternary 

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

    // Provided methods
    fn checked(&self, x: T, y: T, z: T) -> Option<Self::Out> { ... }
    fn many(
        &self,
        x: Arg<'_, T>,
        y: Arg<'_, T>,
        z: Arg<'_, T>,
        n: usize,
        out: &mut Vec<Self::Out>,
    ) -> bool
       where T: Copy + Sync { ... }
    fn many_into(
        &self,
        x: Arg<'_, T>,
        y: Arg<'_, T>,
        z: Arg<'_, T>,
        n: usize,
        out: &mut Slots<'_, Self::Out>,
    ) -> bool
       where T: Copy { ... }
}
Expand description

A function of three 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, z: T) -> Self::Out

Source

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

Source

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

Provided Methods§

Source

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

Source

fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, z: 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>, z: 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§