pub enum TransitionPhase {
Exited,
Entering,
Entered,
Exiting,
}Expand description
The four phases of a transition lifecycle.
Lifecycle: Exited → Entering → Entered →
Exiting → Exited (looping back). The state
machine is symmetric on the way in and out — the
Entering and Exiting phases both have a progress
value in (0.0, 1.0), while Entered and Exited
are terminal resting states (progress pinned to
1.0 and 0.0 respectively).
Phases are public and Clone + Copy + PartialEq so
consumers can write match phase { ... } and dispatch
on them without going through the signal indirection
every time.
Note: not deriving Data / New from lombok because
both Data and New derive macros are only
supported for structs (see UNSUPPORTED_DATA_DERIVE
in lombok-macros 2.0.36). The standard library
derives below are sufficient — we don’t need
getters/setters on the variants.
Variants§
Exited
The element is not yet on-screen (initial state).
progress is 0.0.
Entering
The element is animating in. progress rises from
0.0 toward 1.0 as tick(elapsed_ms) is called.
Entered
The element is fully on-screen. progress is
1.0.
Exiting
The element is animating out. progress falls from
1.0 toward 0.0 as tick(elapsed_ms) is called.
Implementations§
Source§impl TransitionPhase
Inherent implementation of TransitionPhase.
impl TransitionPhase
Inherent implementation of TransitionPhase.
Trait Implementations§
Source§impl Clone for TransitionPhase
impl Clone for TransitionPhase
Source§fn clone(&self) -> TransitionPhase
fn clone(&self) -> TransitionPhase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more