pub trait Operation<N: Network, Value: Parser + ToBits, ValueType: Parser, const NUM_OPERANDS: usize> {
    const OPCODE: Opcode;

    // Required methods
    fn evaluate(inputs: &[Value; NUM_OPERANDS]) -> Result<Value>;
    fn execute<A: Aleo<Network = N>>(
        inputs: &[Literal<A>; NUM_OPERANDS]
    ) -> Result<Literal<A>>;
    fn output_type(inputs: &[ValueType; NUM_OPERANDS]) -> Result<ValueType>;
}

Required Associated Constants§

source

const OPCODE: Opcode

The opcode of the operation.

Required Methods§

source

fn evaluate(inputs: &[Value; NUM_OPERANDS]) -> Result<Value>

Returns the result of evaluating the operation on the given inputs.

source

fn execute<A: Aleo<Network = N>>( inputs: &[Literal<A>; NUM_OPERANDS] ) -> Result<Literal<A>>

Returns the result of executing the operation on the given circuit inputs.

source

fn output_type(inputs: &[ValueType; NUM_OPERANDS]) -> Result<ValueType>

Returns the output type from the given input types.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 1> for AbsOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 1> for AbsWrappedOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 1> for DoubleOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 1> for InvOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 1> for NegOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 1> for NotOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 1> for SquareOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 1> for SquareRootOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for AddOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for AddWrappedOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for AndOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for DivOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for DivWrappedOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for GreaterThanOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for GreaterThanOrEqualOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for LessThanOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for LessThanOrEqualOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for ModuloOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for MulOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for MulWrappedOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for NandOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for NorOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for OrOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for PowOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for PowWrappedOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for RemOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for RemWrappedOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for ShlOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for ShlWrappedOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for ShrOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for ShrWrappedOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for SubOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for SubWrappedOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 2> for XorOperation<N>

source§

impl<N: Network> Operation<N, Literal<N>, LiteralType, 3> for TernaryOperation<N>