pub struct KeyframeAnimation {
pub keyframes: Keyframes,
pub duration: f32,
pub delay: f32,
pub easing: [f32; 4],
pub iterations: Option<u32>,
pub frame_rate: Option<f32>,
}Expand description
animation*: a keyframe animation running natively, forever by default.
Fields§
§keyframes: KeyframesWhat runs.
duration: f32Milliseconds per iteration.
delay: f32Milliseconds before it starts.
easing: [f32; 4]Cubic Bézier x1, y1, x2, y2 (Bounce uses its own per half).
iterations: Option<u32>None repeats forever.
frame_rate: Option<f32>The highest frame rate it needs, in Hz (animationFrameRate);
None: the screen’s highest. Platforms that can lower their frame
rate honor it.
Implementations§
Source§impl KeyframeAnimation
impl KeyframeAnimation
Sourcepub const fn new(keyframes: Keyframes) -> Self
pub const fn new(keyframes: Keyframes) -> Self
keyframes as TS’s animationName alone runs them: a second per
iteration at a constant pace, forever.
Sourcepub const fn easing(self, curve: [f32; 4]) -> Self
pub const fn easing(self, curve: [f32; 4]) -> Self
Along the cubic Bézier curve x1, y1, x2, y2.
Sourcepub const fn iterations(self, count: u32) -> Self
pub const fn iterations(self, count: u32) -> Self
count iterations, then it stops.
Sourcepub const fn frame_rate(self, hz: f32) -> Self
pub const fn frame_rate(self, hz: f32) -> Self
Needs at most hz frames per second (a slow spinner: 30), so the
screen may refresh less often while it is all that moves.
Trait Implementations§
Source§impl Clone for KeyframeAnimation
impl Clone for KeyframeAnimation
impl Copy for KeyframeAnimation
Source§impl Debug for KeyframeAnimation
impl Debug for KeyframeAnimation
Source§impl PartialEq for KeyframeAnimation
impl PartialEq for KeyframeAnimation
impl StructuralPartialEq for KeyframeAnimation
Auto Trait Implementations§
impl Forget for KeyframeAnimation
impl Freeze for KeyframeAnimation
impl Move for KeyframeAnimation
impl RefUnwindSafe for KeyframeAnimation
impl Send for KeyframeAnimation
impl Sync for KeyframeAnimation
impl Unpin for KeyframeAnimation
impl UnsafeUnpin for KeyframeAnimation
impl UnwindSafe for KeyframeAnimation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more