pub enum Moment {
Revert,
Clear,
Dismiss,
Debounce,
}Expand description
A duration named by what it is waiting for.
Each member is a thing a reader is waiting through, and the crate header says what is deliberately left out. Adding one means naming a wait a renderer is already having.
Named Moment rather than Intent so it cannot be confused with
makeover_layout::Intent, which names what a thing is rather than how long
a state lasts.
Variants§
Revert
How long a control shows that it did something before returning to its resting label.
“Copied!” on a button that said “Copy link”. Long enough to be read after the eye has moved back to it, short enough that the control is honest about its own label again before the next click.
Clear
How long a status line holds a message before emptying itself.
The message is a receipt for something the user just did, so it is read or not read immediately. Holding it longer means the next glance at that line reports stale news.
Dismiss
How long a transient notice lives before it starts to leave.
Excludes the leaving itself, which is Motion::Fade. A notice the
user must not miss is not transient and gets no lifetime at all; see
notice_lifetime.
Debounce
How long input waits to settle before the work behind it starts.
A search field that queries on every keystroke, filtered through this. The number is a claim about typing rather than about the query: below roughly 100ms an ordinary typist trips it mid-word, and above roughly 250ms the field feels like it stopped listening.
Implementations§
Source§impl Moment
impl Moment
Sourcepub const fn ms(self) -> u32
pub const fn ms(self) -> u32
The duration in whole milliseconds.
The primary resolution. Self::duration and Self::css are both
spellings of this number, so there is exactly one place it lives.
Sourcepub const fn duration(self) -> Duration
pub const fn duration(self) -> Duration
The duration as a Duration, for the renderers that are not a
browser.
Sourcepub const fn token(self) -> &'static str
pub const fn token(self) -> &'static str
The CSS custom property name, without the leading dashes.