Skip to main content

Program

Trait Program 

pub trait Program: 'static {
    type Value: Copy + 'static;

    // Required methods
    fn go(&mut self, value: Self::Value, now: Instant);
    fn is_animating(&self, now: Instant) -> bool;
}
Expand description

The logic of a Transition.

Required Associated Types§

type Value: Copy + 'static

The type of value that the Program animates.

Required Methods§

fn go(&mut self, value: Self::Value, now: Instant)

Transitions the Program from its current state towards the given value at the given time.

fn is_animating(&self, now: Instant) -> bool

Returns true if the Program is currently in progress.

Implementors§

§

impl<I> Program for Animation<I>
where I: FloatRepresentable + Clone + Copy + PartialEq + 'static,

§

type Value = I