pub struct Timer { /* private fields */ }Expand description
A countdown timer that fires after a fixed duration, optionally repeating.
Timers are updated with the frame delta time; Timer::update returns
the number of times the timer fired during that update (0 or 1 for
one-shot timers, possibly more for repeating timers after a long frame).
Implementations§
Source§impl Timer
Implements creation and countdown logic for Timer.
impl Timer
Implements creation and countdown logic for Timer.
Source§impl Timer
impl Timer
pub fn get_duration(&self) -> f64
pub fn get_mut_duration(&mut self) -> &mut f64
pub fn get_repeating(&self) -> bool
pub fn get_mut_repeating(&mut self) -> &mut bool
pub fn get_paused(&self) -> bool
pub fn get_mut_paused(&mut self) -> &mut bool
pub fn set_paused(&mut self, val: bool) -> &mut Self
pub fn get_finished(&self) -> bool
pub fn get_mut_finished(&mut self) -> &mut bool
pub fn set_finished(&mut self, val: bool) -> &mut Self
Trait Implementations§
impl Copy for Timer
Source§impl PartialOrd for Timer
impl PartialOrd for Timer
impl StructuralPartialEq for Timer
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