pub struct Periodic<S = f32, T = S> { /* private fields */ }Expand description
A generic interval.
Implementations§
Source§impl<S, T> Periodic<S, T>
impl<S, T> Periodic<S, T>
Sourcepub fn elapsed(&mut self, current: S) -> bool
pub fn elapsed(&mut self, current: S) -> bool
Returns true if the interval has elapsed and subtracts the interval since then from the next interval.
Sourcepub fn accumulated(&mut self, current: S) -> bool
pub fn accumulated(&mut self, current: S) -> bool
Returns true if the interval has elapsed and advances by one interval. This function will return true for each interval that has elapsed.
Trait Implementations§
impl<S: Copy, T: Copy> Copy for Periodic<S, T>
Auto Trait Implementations§
impl<S, T> Freeze for Periodic<S, T>
impl<S, T> RefUnwindSafe for Periodic<S, T>where
T: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, T> Send for Periodic<S, T>
impl<S, T> Sync for Periodic<S, T>
impl<S, T> Unpin for Periodic<S, T>
impl<S, T> UnwindSafe for Periodic<S, T>where
T: UnwindSafe,
S: UnwindSafe,
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