pub struct EggTimer { /* private fields */ }Expand description
A timer that counts down and knows when a Duration has elapsed
Implementations
sourceimpl EggTimer
impl EggTimer
sourcepub fn set<D: ToDuration>(time: D) -> EggTimer
pub fn set<D: ToDuration>(time: D) -> EggTimer
Creates a new EggTimer
sourcepub fn duration_left(&self) -> Option<Duration>
pub fn duration_left(&self) -> Option<Duration>
Gets the time left as a Duration
sourcepub fn seconds_left(&self) -> f64
pub fn seconds_left(&self) -> f64
Gets the time left as a floating-point number of seconds
sourcepub fn max_duration(&self) -> Duration
pub fn max_duration(&self) -> Duration
Gets the time the EggTimer was originally set with as a Duration
sourcepub fn max_seconds(&self) -> f64
pub fn max_seconds(&self) -> f64
Gets the time the EggTimer was originally set with as a floating-point number of seconds
sourcepub fn started_at(&self) -> Instant
pub fn started_at(&self) -> Instant
Gets the Instant at which the EggTimer was started
Trait Implementations
sourceimpl Ord for EggTimer
impl Ord for EggTimer
1.21.0 · sourcefn 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 · sourcefn 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
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<EggTimer> for EggTimer
impl PartialOrd<EggTimer> for EggTimer
sourcefn partial_cmp(&self, other: &EggTimer) -> Option<Ordering>
fn partial_cmp(&self, other: &EggTimer) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for EggTimer
impl Eq for EggTimer
impl StructuralEq for EggTimer
impl StructuralPartialEq for EggTimer
Auto Trait Implementations
impl RefUnwindSafe for EggTimer
impl Send for EggTimer
impl Sync for EggTimer
impl Unpin for EggTimer
impl UnwindSafe for EggTimer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more