pub trait FastExpression: Copy {
type Int: PrimInt + Bounded + SaturatingAdd + SaturatingSub + SaturatingMul + NumCast + FixedInt;
const FRAC: usize;
// Required method
fn evaluate_raw(self) -> Self::Int;
// Provided method
fn evaluate<I, const FRAC_OUT: usize>(self) -> FastFixed<I, FRAC_OUT>
where I: Bounded + NumCast + Copy { ... }
}Expand description
A deferred FastFixed expression.
Expressions carry the exact result of an operation (within the 64-bit
intermediate type) together with its number of fractional bits, and are
rounded exactly once when they are converted into a concrete FastFixed
format with From/Into or FastExpression::evaluate, mirroring the
deferred expression templates of the C++ library. Expressions compose:
adding or subtracting two expressions yields a deferred SumExpression,
while combining or comparing an expression with a FastFixed evaluates
the expression in that FastFixed’s format.
Required Associated Constants§
Required Associated Types§
Sourcetype Int: PrimInt + Bounded + SaturatingAdd + SaturatingSub + SaturatingMul + NumCast + FixedInt
type Int: PrimInt + Bounded + SaturatingAdd + SaturatingSub + SaturatingMul + NumCast + FixedInt
The 64-bit intermediate integer type the expression is evaluated in.
Required Methods§
Sourcefn evaluate_raw(self) -> Self::Int
fn evaluate_raw(self) -> Self::Int
Evaluates the expression to its raw value with Self::FRAC fractional bits.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".