Trait Op2

Source
pub trait Op2: Clone + Display {
    // Required methods
    fn cost(&self) -> usize;
    fn try_eval(&self, a1: Value, a2: Value) -> (bool, Value);
}
Expand description

Defines a trait for binary operations in the string synthesis framework.

The trait requires implementors to include methods for calculating the cost associated with executing the operation and attempting evaluation with two input values, returning a tuple with a boolean indicating success or failure and the resultant value. It also requires implementors to derive clone and display functionalities, ensuring that all binary operations can be easily duplicated and formatted to strings for display purposes.

Required Methods§

Source

fn cost(&self) -> usize

Source

fn try_eval(&self, a1: Value, a2: Value) -> (bool, Value)

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.

Implementors§