pub struct AnimationStateMachine {
pub current: AnimationState,
pub transitions: Vec<(AnimationState, AnimationState, String)>,
}Expand description
Animation state machine
Fields§
§current: AnimationState§transitions: Vec<(AnimationState, AnimationState, String)>Implementations§
Source§impl AnimationStateMachine
impl AnimationStateMachine
Sourcepub fn new(initial: AnimationState) -> Self
pub fn new(initial: AnimationState) -> Self
Create a new animation state machine
Sourcepub fn transition(
self,
from: AnimationState,
to: AnimationState,
css: &str,
) -> Self
pub fn transition( self, from: AnimationState, to: AnimationState, css: &str, ) -> Self
Add a transition
Sourcepub fn transition_to(&mut self, new_state: AnimationState)
pub fn transition_to(&mut self, new_state: AnimationState)
Transition to a new state
Sourcepub fn get_transition_css(&self) -> String
pub fn get_transition_css(&self) -> String
Get CSS for current state transitions
Trait Implementations§
Source§impl Clone for AnimationStateMachine
impl Clone for AnimationStateMachine
Source§fn clone(&self) -> AnimationStateMachine
fn clone(&self) -> AnimationStateMachine
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 AnimationStateMachine
impl Debug for AnimationStateMachine
Auto Trait Implementations§
impl Freeze for AnimationStateMachine
impl RefUnwindSafe for AnimationStateMachine
impl Send for AnimationStateMachine
impl Sync for AnimationStateMachine
impl Unpin for AnimationStateMachine
impl UnwindSafe for AnimationStateMachine
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more