#[non_exhaustive]pub enum Transition {
Instant,
Tween {
duration: f32,
easing: Easing,
},
Spring(Spring),
}Expand description
How a value travels to a new target.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Instant
No animation.
Tween
A fixed duration along a curve.
Spring(Spring)
A spring, which takes as long as it takes and keeps velocity when redirected.
Implementations§
Source§impl Transition
impl Transition
Sourcepub const fn tween(duration: f32, easing: Easing) -> Transition
pub const fn tween(duration: f32, easing: Easing) -> Transition
A timed transition.
Sourcepub const fn fast() -> Transition
pub const fn fast() -> Transition
Hover, press and focus color (the duration-fast token, ease-out).
Sourcepub const fn base() -> Transition
pub const fn base() -> Transition
Small layout and opacity changes (the duration-base token).
Sourcepub const fn slow() -> Transition
pub const fn slow() -> Transition
Panels and sheets entering (the duration-slow token).
Sourcepub const fn draw_in() -> Transition
pub const fn draw_in() -> Transition
Data drawing in the first time a chart is painted (the duration-draw token):
long, and fast at first, so the shape reads at once and settles softly.
Sourcepub const fn snappy() -> Transition
pub const fn snappy() -> Transition
Things changing place or size.
Sourcepub const fn gentle() -> Transition
pub const fn gentle() -> Transition
Panels and sheets.
Sourcepub const fn without_bounce(self) -> Transition
pub const fn without_bounce(self) -> Transition
The version of this transition for properties that stay animated under reduced motion (color, opacity): a spring becomes a short fade.
Trait Implementations§
Source§impl Clone for Transition
impl Clone for Transition
Source§fn clone(&self) -> Transition
fn clone(&self) -> Transition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Transition
Source§impl Debug for Transition
impl Debug for Transition
Source§impl PartialEq for Transition
impl PartialEq for Transition
impl StructuralPartialEq for Transition
Auto Trait Implementations§
impl Freeze for Transition
impl RefUnwindSafe for Transition
impl Send for Transition
impl Sync for Transition
impl Unpin for Transition
impl UnsafeUnpin for Transition
impl UnwindSafe for Transition
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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