Skip to main content

MotionData

Trait MotionData 

Source
pub trait MotionData<const N: usize>:
    Copy
    + Debug
    + PartialEq
    + 'static {
    // Required methods
    fn channels(self) -> [f64; N];
    fn with_channels(self, values: [f64; N]) -> Self;
    fn compatible(self, other: Self) -> bool;
}
Expand description

Fixed numeric representation of a typed animation value. Implementations must return finite channels and reconstruct drawable values without allocating. compatible identifies an unchanged property mask; keyframes cannot silently introduce/remove properties. Implement this for application-owned value types.

Required Methods§

Source

fn channels(self) -> [f64; N]

Numeric channels, including unclamped spring presentation where available.

Source

fn with_channels(self, values: [f64; N]) -> Self

Reconstructs a value using this value’s property mask and sampled channels.

Source

fn compatible(self, other: Self) -> bool

Whether both values declare the same properties.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl MotionData<1> for f64

Source§

fn channels(self) -> [f64; 1]

Source§

fn with_channels(self, values: [f64; 1]) -> Self

Source§

fn compatible(self, _: Self) -> bool

Source§

impl<const N: usize> MotionData<N> for [f64; N]

Source§

fn channels(self) -> [f64; N]

Source§

fn with_channels(self, values: [f64; N]) -> Self

Source§

fn compatible(self, _: Self) -> bool

Implementors§