#[repr(C, u8)]pub enum Instant {
System(AzInstantPtr),
Tick(SystemTick),
}Variants§
System(AzInstantPtr)
Tick(SystemTick)
Implementations§
Source§impl Instant
impl Instant
Sourcepub fn linear_interpolate(&self, start: Self, end: Self) -> f32
pub fn linear_interpolate(&self, start: Self, end: Self) -> f32
Returns a number from 0.0 to 1.0 indicating the current linear interpolation value between (start, end)
Sourcepub fn add_optional_duration(&self, duration: Option<&Duration>) -> Self
pub fn add_optional_duration(&self, duration: Option<&Duration>) -> Self
Adds a duration to the instant, does nothing in undefined cases (i.e. trying to add a Duration::Tick to an Instant::System)
pub fn into_std_instant(self) -> StdInstant
Sourcepub fn duration_since(&self, earlier: &Instant) -> Duration
pub fn duration_since(&self, earlier: &Instant) -> Duration
Calculates the duration since an earlier point in time
- Panics if the earlier Instant was created after the current Instant
- Panics if the two enums do not have the same variant (tick / std)
Trait Implementations§
Source§impl From<Instant> for Instant
Available on crate feature std only.
impl From<Instant> for Instant
Available on crate feature
std only.Source§fn from(s: StdInstant) -> Instant
fn from(s: StdInstant) -> Instant
Converts to this type from the input type.
Source§impl Ord for Instant
impl Ord for Instant
Source§impl PartialOrd for Instant
impl PartialOrd 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more