pub enum AnimationState<T: Animatable> {
Idle,
Running {
mode: AnimationMode,
config_handle: ConfigHandle,
},
Sequence {
sequence: Arc<AnimationSequence<T>>,
config_handle: ConfigHandle,
},
Keyframes {
animation: Arc<KeyframeAnimation<T>>,
config_handle: ConfigHandle,
},
}Expand description
Animation state enum that represents the current mode of animation This replaces complex branching logic with efficient state dispatch
Variants§
Idle
Animation is not running
Running
Single animation is running with specified mode
Sequence
Animation sequence is active
Keyframes
Keyframe animation is active
Implementations§
Source§impl<T: Animatable + Send + 'static> AnimationState<T>
impl<T: Animatable + Send + 'static> AnimationState<T>
Sourcepub fn new_running(mode: AnimationMode, config_handle: ConfigHandle) -> Self
pub fn new_running(mode: AnimationMode, config_handle: ConfigHandle) -> Self
Creates a new running state with the specified mode
Sourcepub fn new_sequence(
sequence: Arc<AnimationSequence<T>>,
config_handle: ConfigHandle,
) -> Self
pub fn new_sequence( sequence: Arc<AnimationSequence<T>>, config_handle: ConfigHandle, ) -> Self
Creates a new sequence state
Sourcepub fn new_keyframes(
animation: Arc<KeyframeAnimation<T>>,
config_handle: ConfigHandle,
) -> Self
pub fn new_keyframes( animation: Arc<KeyframeAnimation<T>>, config_handle: ConfigHandle, ) -> Self
Creates a new keyframes state
Sourcepub fn config_handle(&self) -> Option<&ConfigHandle>
pub fn config_handle(&self) -> Option<&ConfigHandle>
Gets the current config handle if available
Trait Implementations§
Source§impl<T: Clone + Animatable> Clone for AnimationState<T>
impl<T: Clone + Animatable> Clone for AnimationState<T>
Source§fn clone(&self) -> AnimationState<T>
fn clone(&self) -> AnimationState<T>
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<T: Animatable> Default for AnimationState<T>
impl<T: Animatable> Default for AnimationState<T>
Auto Trait Implementations§
impl<T> Freeze for AnimationState<T>
impl<T> RefUnwindSafe for AnimationState<T>where
T: RefUnwindSafe,
impl<T> Send for AnimationState<T>
impl<T> Sync for AnimationState<T>
impl<T> Unpin for AnimationState<T>
impl<T> UnwindSafe for AnimationState<T>where
T: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.