i_slint_core::properties

Trait InterpolatedPropertyValue

Source
pub trait InterpolatedPropertyValue:
    PartialEq
    + Default
    + 'static {
    // Required method
    fn interpolate(&self, target_value: &Self, t: f32) -> Self;
}
Expand description

InterpolatedPropertyValue is a trait used to enable properties to be used with animations that interpolate values. The basic requirement is the ability to apply a progress that’s typically between 0 and 1 to a range.

Required Methods§

Source

fn interpolate(&self, target_value: &Self, t: f32) -> Self

Returns the interpolated value between self and target_value according to the progress parameter t that’s usually between 0 and 1. With certain animation easing curves it may over- or undershoot though.

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.

Implementations on Foreign Types§

Source§

impl InterpolatedPropertyValue for f32

Source§

fn interpolate(&self, target_value: &Self, t: f32) -> Self

Source§

impl InterpolatedPropertyValue for i32

Source§

fn interpolate(&self, target_value: &Self, t: f32) -> Self

Source§

impl InterpolatedPropertyValue for i64

Source§

fn interpolate(&self, target_value: &Self, t: f32) -> Self

Source§

impl InterpolatedPropertyValue for u8

Source§

fn interpolate(&self, target_value: &Self, t: f32) -> Self

Implementors§