pub struct Tick {
now: Duration,
predicted_dt: Option<Duration>,
}Expand description
The frame clock an easing is read against: when this frame is, and how long the next one is expected to take.
A host with a frame rate of its own states the prediction
(Tick::predicting); one that knows only what time it is says
Tick::at and whoever holds the previous tick fills it in
(Tick::after).
Fields§
§now: Duration§predicted_dt: Option<Duration>Implementations§
Source§impl Tick
impl Tick
Sourcepub const fn predicting(now: Duration, predicted_dt: Duration) -> Self
pub const fn predicting(now: Duration, predicted_dt: Duration) -> Self
The clock as a host that knows how long its frames take states it.
Sourcepub fn after(self, previous: Self) -> Self
pub fn after(self, previous: Self) -> Self
This tick with an unstated prediction taken from the interval since
previous, which is what a host reading its own frame history would
have predicted.
pub const fn now(self) -> Duration
Sourcepub const fn predicted_dt(self) -> Duration
pub const fn predicted_dt(self) -> Duration
How long the next frame is expected to take: what the host stated, or
what Tick::after derived, and nothing on a tick that has neither.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tick
impl<'de> Deserialize<'de> for Tick
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Tick
impl StructuralPartialEq for Tick
Auto Trait Implementations§
impl Freeze for Tick
impl RefUnwindSafe for Tick
impl Send for Tick
impl Sync for Tick
impl Unpin for Tick
impl UnsafeUnpin for Tick
impl UnwindSafe for Tick
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