#[repr(transparent)]pub struct Instant(pub u64);
Expand description
Represent an instant, in milliseconds since the AnimationDriver’s initial_instant
Tuple Fields§
§0: u64
Implementations§
Source§impl Instant
impl Instant
Sourcepub fn duration_since(self, earlier: Instant) -> Duration
pub fn duration_since(self, earlier: Instant) -> Duration
Returns the amount of time elapsed since an other instant.
Equivalent to self - earlier
Sourcepub fn now() -> Self
pub fn now() -> Self
Wrapper around std::time::Instant::now()
that delegates to the backend
and allows working in no_std environments.
Trait Implementations§
Source§impl AddAssign<Duration> for Instant
impl AddAssign<Duration> for Instant
Source§fn add_assign(&mut self, other: Duration)
fn add_assign(&mut self, other: Duration)
Performs the
+=
operation. Read moreSource§impl Ord for Instant
impl Ord for Instant
Source§impl PartialOrd for Instant
impl PartialOrd for Instant
Source§impl SubAssign<Duration> for Instant
impl SubAssign<Duration> for Instant
Source§fn sub_assign(&mut self, other: Duration)
fn sub_assign(&mut self, other: Duration)
Performs the
-=
operation. Read moreimpl Copy for Instant
impl Eq for Instant
impl StructuralPartialEq for Instant
Auto Trait Implementations§
impl Freeze for Instant
impl RefUnwindSafe for Instant
impl Send for Instant
impl Sync for Instant
impl Unpin for Instant
impl UnwindSafe for Instant
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