pub trait FunctionLogic {
const FUNCTION_TYPE: FunctionType;
// Required methods
fn validate_load(
x_in: Decimal,
y_in: Decimal,
) -> Result<(Decimal, ValueCode)>;
fn eval(
fd: &FunctionData,
x: Decimal,
interp: Interpolation,
saturating: bool,
) -> Result<Decimal>;
// Provided methods
fn proportion_difference(a: Decimal, b: Decimal) -> Result<Decimal> { ... }
fn interpolate(
fd: &FunctionData,
x: Decimal,
interp: Interpolation,
) -> Result<Decimal> { ... }
}
Required Associated Constants§
const FUNCTION_TYPE: FunctionType
Required Methods§
fn validate_load(x_in: Decimal, y_in: Decimal) -> Result<(Decimal, ValueCode)>
fn eval( fd: &FunctionData, x: Decimal, interp: Interpolation, saturating: bool, ) -> Result<Decimal>
Provided Methods§
fn proportion_difference(a: Decimal, b: Decimal) -> Result<Decimal>
fn interpolate( fd: &FunctionData, x: Decimal, interp: Interpolation, ) -> Result<Decimal>
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.