pub struct Tick { /* private fields */ }
Expand description
A value that tracks when a system ran relative to other systems. This is used to power change detection.
Note that a system that hasn’t been run yet has a Tick
of 0.
Implementations§
Source§impl Tick
impl Tick
Sourcepub const MAX: Self = _
pub const MAX: Self = _
The maximum relative age for a change tick.
The value of this is equal to MAX_CHANGE_AGE
.
Since change detection will not work for any ticks older than this, ticks are periodically scanned to ensure their relative values are below this.
Sourcepub fn is_newer_than(self, last_run: Tick, this_run: Tick) -> bool
pub fn is_newer_than(self, last_run: Tick, this_run: Tick) -> bool
Returns true
if this Tick
occurred since the system’s last_run
.
this_run
is the current tick of the system, used as a reference to help deal with wraparound.
Trait Implementations§
impl Copy for Tick
impl Eq 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§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> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self
using data from the given World
.