TernaryOp

Trait TernaryOp 

Source
pub trait TernaryOp: BinaryOp {
    // Provided methods
    fn create_maj3(
        &mut self,
        a: Self::Signal,
        b: Self::Signal,
        c: Self::Signal,
    ) -> Self::Signal { ... }
    fn create_ite(
        &mut self,
        condition: Self::Signal,
        then: Self::Signal,
        otherwise: Self::Signal,
    ) -> Self::Signal { ... }
    fn create_xor3(
        &mut self,
        a: Self::Signal,
        b: Self::Signal,
        c: Self::Signal,
    ) -> Self::Signal { ... }
}
Expand description

Logic operations with three inputs.

Provided Methods§

Source

fn create_maj3( &mut self, a: Self::Signal, b: Self::Signal, c: Self::Signal, ) -> Self::Signal

Create three-input majority gate.

Source

fn create_ite( &mut self, condition: Self::Signal, then: Self::Signal, otherwise: Self::Signal, ) -> Self::Signal

Create if-then-else.

Source

fn create_xor3( &mut self, a: Self::Signal, b: Self::Signal, c: Self::Signal, ) -> Self::Signal

Create three-input XOR.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<TO: TernaryOp + ?Sized> TernaryOp for &mut TO

Source§

fn create_maj3( &mut self, a: Self::Signal, b: Self::Signal, c: Self::Signal, ) -> Self::Signal

Source§

fn create_ite( &mut self, condition: Self::Signal, then: Self::Signal, otherwise: Self::Signal, ) -> Self::Signal

Source§

fn create_xor3( &mut self, a: Self::Signal, b: Self::Signal, c: Self::Signal, ) -> Self::Signal

Implementors§