Skip to main content

SpringTarget

Trait SpringTarget 

Source
pub trait SpringTarget: 'static {
    type Output;

    // Required methods
    fn target(&self) -> f32;
    fn resolve(&self, value: f32) -> Self::Output;
}
Expand description

A value that can be targeted by a one-dimensional spring.

Implementations may project the spring coordinate into a richer output, allowing a discrete state or a path through a multidimensional value to be driven by one spring.

Required Associated Types§

Source

type Output

The value supplied to the spring animator.

Required Methods§

Source

fn target(&self) -> f32

Returns the target in the spring’s coordinate space.

Source

fn resolve(&self, value: f32) -> Self::Output

Projects a spring coordinate into the animated output.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SpringTarget for bool

Source§

type Output = AnimationPhase

Source§

fn target(&self) -> f32

Source§

fn resolve(&self, value: f32) -> Self::Output

Source§

impl SpringTarget for f32

Source§

type Output = f32

Source§

fn target(&self) -> f32

Source§

fn resolve(&self, value: f32) -> Self::Output

Implementors§