pub struct RuntimeTick { /* private fields */ }Expand description
⬡ 🕘 A deterministic logical execution-time counter.
📍 run/time
📦 size_of::<RuntimeTick>() == 8 bytes / 64 bits
RuntimeTick represents execution time as an explicitly advanced,
monotonically increasing tick count.
It is constructed, not observed: ticks are advanced explicitly by program logic rather than sampled from external clocks.
§Semantics
- The origin (
0) is synthetic and application-defined. - Ticks have no inherent unit; their meaning is determined by context (frames, cycles, steps, events, etc.).
- Advancement is explicit and deterministic.
For sampled or system-backed time, use a TimeSource instead.
Implementations§
Source§impl RuntimeTick
impl RuntimeTick
Sourcepub const fn new(ticks: u64) -> Self
pub const fn new(ticks: u64) -> Self
Creates a new logical time value with the given tick count.
Sourcepub const fn advance_mut(&mut self, delta: u64)
pub const fn advance_mut(&mut self, delta: u64)
Advances this time by delta ticks in place.
Sourcepub const fn advanced(self, delta: u64) -> Self
pub const fn advanced(self, delta: u64) -> Self
Returns a new RuntimeTick advanced by delta ticks.
Sourcepub const fn delta(self, earlier: Self) -> u64
pub const fn delta(self, earlier: Self) -> u64
Returns the difference in ticks between two times.
The result is saturating and never negative.
Sourcepub const fn is_after(self, other: Self) -> bool
pub const fn is_after(self, other: Self) -> bool
Returns whether this time is strictly after other.
Trait Implementations§
Source§impl Clone for RuntimeTick
impl Clone for RuntimeTick
Source§fn clone(&self) -> RuntimeTick
fn clone(&self) -> RuntimeTick
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RuntimeTick
Source§impl Debug for RuntimeTick
impl Debug for RuntimeTick
impl Eq for RuntimeTick
Source§impl Hash for RuntimeTick
impl Hash for RuntimeTick
Source§impl Ord for RuntimeTick
impl Ord for RuntimeTick
Source§fn cmp(&self, other: &RuntimeTick) -> Ordering
fn cmp(&self, other: &RuntimeTick) -> Ordering
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
Source§impl PartialEq for RuntimeTick
impl PartialEq for RuntimeTick
Source§fn eq(&self, other: &RuntimeTick) -> bool
fn eq(&self, other: &RuntimeTick) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for RuntimeTick
impl PartialOrd for RuntimeTick
impl StructuralPartialEq for RuntimeTick
Auto Trait Implementations§
impl Freeze for RuntimeTick
impl RefUnwindSafe for RuntimeTick
impl Send for RuntimeTick
impl Sync for RuntimeTick
impl Unpin for RuntimeTick
impl UnsafeUnpin for RuntimeTick
impl UnwindSafe for RuntimeTick
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
Returns a deterministic hash of the
TypeId of Self using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
Available on crate feature
alloc only.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> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
The alignment of this type in bytes.
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Returns the alignment of this type in bytes.
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Source§impl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Know whether dropping values of this type matters, in compile-time.
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Returns the minimum alignment of the type in bytes. Read more
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Returns the alignment of the pointed-to value in bytes. Read more
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Returns the size of a type in bytes. Read more
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Returns the size of the pointed-to value in bytes. Read more
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
Returns
true if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
Forgets about
self without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
Available on crate feature
unsafe_layout only.Returns the value of type
T represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
Available on crate feature
unsafe_layout only.Returns the value of type
T represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
Available on crate feature
unsafe_slice only.