pub struct Timer {
pub mode: TimerMode,
pub state: TimerState,
pub total_seconds: u32,
pub elapsed_seconds: u32,
pub started_at: Option<Instant>,
pub completed_focus_sessions: u32,
pub custom_minutes: u32,
pub config: TimerConfig,
pub session_pause_count: u32,
pub session_pause_seconds: u32,
/* private fields */
}Fields§
§mode: TimerMode§state: TimerState§total_seconds: u32§elapsed_seconds: u32§started_at: Option<Instant>§completed_focus_sessions: u32§custom_minutes: u32§config: TimerConfig§session_pause_count: u32§session_pause_seconds: u32Implementations§
Source§impl Timer
impl Timer
pub fn new(config: TimerConfig) -> Self
pub fn reset_session_pauses(&mut self)
pub fn session_meta(&self) -> SessionMeta
pub fn sync_config(&mut self, config: TimerConfig)
pub fn duration_seconds(&self) -> u32
pub fn configure(&mut self, mode: TimerMode)
pub fn set_custom_minutes(&mut self, minutes: u32)
pub fn set_focus_minutes(&mut self, minutes: u32)
pub fn current_elapsed_secs_f64(&self) -> f64
pub fn current_elapsed_seconds(&self) -> u32
pub fn start(&mut self)
pub fn pause(&mut self)
pub fn commit_pause_duration(&mut self)
pub fn reset(&mut self)
pub fn tick(&mut self) -> bool
pub fn skip(&mut self)
pub fn remaining_seconds(&self) -> i32
pub fn is_one_minute_warning(&self) -> bool
pub fn progress(&self) -> f64
pub fn remaining_secs_f64(&self) -> f64
pub fn format_remaining(&self) -> String
pub fn format_remaining_parts(&self) -> (String, String)
pub fn session_in_cycle(&self) -> u32
pub fn focus_sessions_in_cycle(&self) -> u32
pub fn cycle_label(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnsafeUnpin for Timer
impl UnwindSafe for Timer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more