pub struct FrameTime(/* private fields */);Expand description
A point in time supplied by the shell, in monotonic nanoseconds.
The origin is arbitrary and shell-specific, so widgets may only difference
two FrameTimes (via FrameTime::saturating_sub), never interpret one
absolutely or compare times from different shells.
Implementations§
Source§impl FrameTime
impl FrameTime
Sourcepub const ZERO: FrameTime
pub const ZERO: FrameTime
The zero instant, also the “no time available” fallback for legacy/test paint paths.
Sourcepub const fn from_nanos(nanos: u64) -> Self
pub const fn from_nanos(nanos: u64) -> Self
Build a FrameTime from a raw monotonic-nanosecond count.
Sourcepub fn as_secs_f64(self) -> f64
pub fn as_secs_f64(self) -> f64
This instant as fractional seconds from the (arbitrary) origin.
Sourcepub fn saturating_sub(self, earlier: FrameTime) -> Duration
pub fn saturating_sub(self, earlier: FrameTime) -> Duration
The non-negative Duration elapsed from earlier to self, saturating at
zero for a non-monotonic clock (the basis of AnimationController::advance’s
never-negative delta).
Trait Implementations§
impl Copy for FrameTime
impl Eq for FrameTime
Source§impl Ord for FrameTime
impl Ord for FrameTime
1.21.0 (const: unstable) · Source§fn 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 (const: unstable) · Source§fn 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
Source§impl PartialOrd for FrameTime
impl PartialOrd for FrameTime
impl StructuralPartialEq for FrameTime
Auto Trait Implementations§
impl Freeze for FrameTime
impl RefUnwindSafe for FrameTime
impl Send for FrameTime
impl Sync for FrameTime
impl Unpin for FrameTime
impl UnsafeUnpin for FrameTime
impl UnwindSafe for FrameTime
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.