pub struct CustomKeyframe {
pub name: String,
pub steps: Vec<(f32, KeyframeStep)>,
pub duration: u32,
pub timing_function: TimingFunction,
pub delay: u32,
pub iteration_count: AnimationIteration,
pub direction: AnimationDirection,
pub fill_mode: AnimationFillMode,
pub play_state: AnimationPlayState,
}Expand description
Custom keyframe animation
Fields§
§name: StringAnimation name
steps: Vec<(f32, KeyframeStep)>Keyframe steps (0.0 to 1.0)
duration: u32Animation duration in milliseconds
timing_function: TimingFunctionAnimation timing function
delay: u32Animation delay in milliseconds
iteration_count: AnimationIterationAnimation iteration count
direction: AnimationDirectionAnimation direction
fill_mode: AnimationFillModeAnimation fill mode
play_state: AnimationPlayStateAnimation play state
Implementations§
Source§impl CustomKeyframe
impl CustomKeyframe
Sourcepub fn add_step(&mut self, offset: f32, step: KeyframeStep)
pub fn add_step(&mut self, offset: f32, step: KeyframeStep)
Add a keyframe step
Sourcepub fn to_css_keyframes(&self) -> String
pub fn to_css_keyframes(&self) -> String
Convert to CSS @keyframes rule
Sourcepub fn to_class_name(&self) -> String
pub fn to_class_name(&self) -> String
Convert to class name
Sourcepub fn to_css_animation(&self) -> String
pub fn to_css_animation(&self) -> String
Convert to CSS animation property
Trait Implementations§
Source§impl Clone for CustomKeyframe
impl Clone for CustomKeyframe
Source§fn clone(&self) -> CustomKeyframe
fn clone(&self) -> CustomKeyframe
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomKeyframe
impl Debug for CustomKeyframe
Source§impl<'de> Deserialize<'de> for CustomKeyframe
impl<'de> Deserialize<'de> for CustomKeyframe
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CustomKeyframe
impl Display for CustomKeyframe
Source§impl PartialEq for CustomKeyframe
impl PartialEq for CustomKeyframe
Source§impl Serialize for CustomKeyframe
impl Serialize for CustomKeyframe
impl StructuralPartialEq for CustomKeyframe
Auto Trait Implementations§
impl Freeze for CustomKeyframe
impl RefUnwindSafe for CustomKeyframe
impl Send for CustomKeyframe
impl Sync for CustomKeyframe
impl Unpin for CustomKeyframe
impl UnwindSafe for CustomKeyframe
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