pub trait Interpolate: Copy {
// Required methods
fn interpolate(self, end: Self, amount: f32) -> Self;
fn is_valid_interpolation_value(self) -> bool;
}Expand description
Value type that can be interpolated by Tween.
Implementations should avoid producing NaN for normal finite inputs. amount
is already eased by the caller and is usually in 0.0..=1.0, but overshoot
curves may pass values above 1.0.
Required Methods§
Sourcefn interpolate(self, end: Self, amount: f32) -> Self
fn interpolate(self, end: Self, amount: f32) -> Self
Interpolates between self and end.
Sourcefn is_valid_interpolation_value(self) -> bool
fn is_valid_interpolation_value(self) -> bool
Returns whether this value may be stored by a Tween.
Implementations must reject any invalid representation that interpolation could otherwise propagate into renderer or camera state.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".