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§
Required Methods§
Sourcefn evaluate(inputs: &[Value; NUM_OPERANDS]) -> Result<Value>
fn evaluate(inputs: &[Value; NUM_OPERANDS]) -> Result<Value>
Returns the result of evaluating the operation on the given inputs.
Sourcefn execute<A: Aleo<Network = N>>(
inputs: &[Literal<A>; NUM_OPERANDS],
) -> Result<Literal<A>>
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.
Sourcefn output_type(inputs: &[ValueType; NUM_OPERANDS]) -> Result<ValueType>
fn output_type(inputs: &[ValueType; NUM_OPERANDS]) -> Result<ValueType>
Returns the output type from the given input types.
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.