pub struct TimerState {
pub mode: TimerMode,
pub duration: Option<Duration>,
pub elapsed: Duration,
pub running: bool,
pub warning_threshold: Option<Duration>,
}Expand description
Timer state for the presentation.
Fields§
§mode: TimerModeTimer mode.
duration: Option<Duration>Configured total duration, if any.
elapsed: DurationTime elapsed since the timer started.
running: boolWhether the timer is currently running.
warning_threshold: Option<Duration>Threshold for the warning phase.
Implementations§
Source§impl TimerState
impl TimerState
Sourcepub fn phase(&self) -> TimerPhase
pub fn phase(&self) -> TimerPhase
Compute the current timer phase.
Sourcepub fn display_time(&self) -> Duration
pub fn display_time(&self) -> Duration
The display time for the timer. For countdown mode, returns time remaining (clamped to 0). For elapsed mode, returns time elapsed.
Trait Implementations§
Source§impl Clone for TimerState
impl Clone for TimerState
Source§fn clone(&self) -> TimerState
fn clone(&self) -> TimerState
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 moreSource§impl Debug for TimerState
impl Debug for TimerState
Auto Trait Implementations§
impl Freeze for TimerState
impl RefUnwindSafe for TimerState
impl Send for TimerState
impl Sync for TimerState
impl Unpin for TimerState
impl UnsafeUnpin for TimerState
impl UnwindSafe for TimerState
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