Trait style::values::distance::ComputeSquaredDistance [] [src]

pub trait ComputeSquaredDistance {
    fn compute_squared_distance(
        &self,
        other: &Self
    ) -> Result<SquaredDistance, ()>; }

A trait to compute squared distances between two animatable values.

This trait is derivable with #[derive(ComputeSquaredDistance)]. The derived implementation uses a match expression with identical patterns for both self and other, calling ComputeSquaredDistance::compute_squared_distance on each fields of the values.

If a variant is annotated with #[animation(error)], the corresponding match arm is not generated.

If the two values are not similar, an error is returned unless a fallback function has been specified through #[distance(fallback)].

Required Methods

Computes the squared distance between two animatable values.

Implementations on Foreign Types

impl ComputeSquaredDistance for u16
[src]

impl ComputeSquaredDistance for i32
[src]

impl ComputeSquaredDistance for f32
[src]

impl ComputeSquaredDistance for f64
[src]

impl<T> ComputeSquaredDistance for Option<T> where
    T: ComputeSquaredDistance
[src]

impl<T> ComputeSquaredDistance for Size2D<T> where
    T: ComputeSquaredDistance
[src]

impl<T> ComputeSquaredDistance for SmallVec<[T; 1]> where
    T: ComputeSquaredDistance + RepeatableListAnimatable
[src]

impl<T> ComputeSquaredDistance for Vec<T> where
    T: ComputeSquaredDistance + RepeatableListAnimatable
[src]

Implementors