pub enum Motion {
Fade,
Quick,
}Expand description
How long a change takes, as opposed to how long a state lasts.
Variants§
Fade
A thing leaving: opacity to zero, then gone.
The whole of the departure: a renderer that removes the node itself waits this out first.
Quick
A state answering a pointer or a press: a hover tone, a pressed bevel, a disclosure turning.
Implementations§
Source§impl Motion
impl Motion
Sourcepub const fn duration(self) -> Duration
pub const fn duration(self) -> Duration
The full duration as a Duration, under either motion preference;
duration_for answers the preference.
Sourcepub const fn duration_for(self, preference: MotionPreference) -> Duration
pub const fn duration_for(self, preference: MotionPreference) -> Duration
The duration under the reader’s motion preference: duration
in full, and zero under MotionPreference::Reduced, as
reduced_motion_css sets every --motion-* token to 0ms.
The caller supplies the preference its platform reported.
assert_eq!(Motion::Fade.duration_for(MotionPreference::Full), Motion::Fade.duration());
assert_eq!(Motion::Fade.duration_for(MotionPreference::Reduced), Duration::ZERO);Trait Implementations§
impl Copy for Motion
impl Eq for Motion
Source§impl Ord for Motion
impl Ord for Motion
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Motion
impl PartialOrd for Motion
impl StructuralPartialEq for Motion
Auto Trait Implementations§
impl Forget for Motion
impl Freeze for Motion
impl Move for Motion
impl RefUnwindSafe for Motion
impl Send for Motion
impl Sync for Motion
impl Unpin for Motion
impl UnsafeUnpin for Motion
impl UnwindSafe for Motion
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