pub struct TimelineConfiguration<Data>where
    Data: Clone + Debug,{ /* private fields */ }
Expand description

Configuration and fluent builder interface for a Timeline type.

Works with TimelineBuilder to aid in the creation of timelines. TimelineBuilder cannot be implemented ahead of time, because it depends on the specific set of animation properties; to complete the API, applications (or the Animate macro) define an implementation of TimelineBuilder for the TimelineConfiguration whose keyframe type corresponds to the specific timeline being created.

Refer to the macroless_timeline example for details on how the two are connected.

Implementations§

source§

impl<Data> TimelineConfiguration<Data>where Data: Clone + Debug,

source

pub fn default_easing( self, default_easing: Easing ) -> TimelineConfiguration<Data>

Configures the default easing for this timeline.

The default easing is applied until a Keyframe overrides it. Once a frame specifies its own easing, that becomes the new default until another frame overrides it again, etc. If no keyframes specify their own easing, then this easing applies to every frame.

source

pub fn delay_seconds(self, delay_seconds: f32) -> TimelineConfiguration<Data>

Configures the delay, in seconds, before the animation will start.

Delay is applied once at the beginning of the timeline, and does not contribute to the duration_seconds, nor does it apply to any cycles after the first if a repeat setting is specified.

source

pub fn duration_seconds( self, duration_seconds: f32 ) -> TimelineConfiguration<Data>

Configures the animation duration, in seconds.

If the animation repeats, this is the duration of each cycle. If the animation reverses, regardless of whether or not it repeats, then the first half of the duration is used for the forward animation and the second half is used for the reverse animation.

source

pub fn keyframe( self, builder: impl KeyframeBuilder<Data = Data> ) -> TimelineConfiguration<Data>

Adds a single Keyframe to the animation, using the supplied builder to create the keyframe along with its specific typed data.

source

pub fn repeat(self, repeat: Repeat) -> TimelineConfiguration<Data>

Configures the number of repetitions (cycles).

source

pub fn reverse(self, reverse: bool) -> TimelineConfiguration<Data>

Configures whether or not the animation should automatically reverse.

Reversing takes up the second half of any given cycle and uses the same keyframes, easing and other timing properties as the normal forward animation.

Trait Implementations§

source§

impl<Data> Clone for TimelineConfiguration<Data>where Data: Clone + Debug,

source§

fn clone(&self) -> TimelineConfiguration<Data>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Data> Debug for TimelineConfiguration<Data>where Data: Debug + Clone,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<Data> Default for TimelineConfiguration<Data>where Data: Clone + Debug,

source§

fn default() -> TimelineConfiguration<Data>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<Data> !RefUnwindSafe for TimelineConfiguration<Data>

§

impl<Data> Send for TimelineConfiguration<Data>where Data: Send,

§

impl<Data> Sync for TimelineConfiguration<Data>where Data: Sync,

§

impl<Data> Unpin for TimelineConfiguration<Data>where Data: Unpin,

§

impl<Data> !UnwindSafe for TimelineConfiguration<Data>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.