pub struct ContiguousComponentTicksRef<'w> { /* private fields */ }Expand description
Data type storing contiguously lying ticks.
Retrievable via ContiguousRef::split and probably only useful if you want to use the following
methods:
Implementations§
Source§impl<'w> ContiguousComponentTicksRef<'w>
impl<'w> ContiguousComponentTicksRef<'w>
Sourcepub fn new(
added: &'w [Tick],
changed: &'w [Tick],
last_run: Tick,
this_run: Tick,
caller: MaybeLocation<&'w [&'static Location<'static>]>,
) -> Option<ContiguousComponentTicksRef<'w>>
pub fn new( added: &'w [Tick], changed: &'w [Tick], last_run: Tick, this_run: Tick, caller: MaybeLocation<&'w [&'static Location<'static>]>, ) -> Option<ContiguousComponentTicksRef<'w>>
Creates a new ContiguousComponentTicksRef using provided values or returns None if lengths of
added, changed and changed_by do not match
This is an advanced feature, ContiguousComponentTicksRefs are designed to be created by
engine-internal code and consumed by end-user code.
added-Ticks that store the tick when the wrapped value was created.changed-Ticks that store the last time the wrapped value was changed.last_run- ATick, occurring beforethis_run, which is used as a reference to determine whether the wrapped value is newly added or changed.this_run- ATickcorresponding to the current point in time – “now”.caller-Locations that store the location when the wrapper value was changed.
Sourcepub fn changed_by(&self) -> MaybeLocation<&[&'static Location<'static>]>
pub fn changed_by(&self) -> MaybeLocation<&[&'static Location<'static>]>
Returns changed by locations’ slice.
Sourcepub fn is_changed_iter(&self) -> impl Iterator<Item = bool>
pub fn is_changed_iter(&self) -> impl Iterator<Item = bool>
Returns an iterator where the i-th item corresponds to whether the i-th component was
marked as changed. If the value equals true, then the component was changed.
§Example
fn some_system(mut query: Query<Ref<A>>) {
for a in query.contiguous_iter().unwrap() {
let (a_values, a_ticks) = ContiguousRef::split(a);
for (value, is_changed) in a_values.iter().zip(a_ticks.is_changed_iter()) {
if is_changed {
// do something
}
}
}
}Sourcepub fn is_added_iter(&self) -> impl Iterator<Item = bool>
pub fn is_added_iter(&self) -> impl Iterator<Item = bool>
Returns an iterator where the i-th item corresponds to whether the i-th component was
marked as added. If the value equals true, then the component was added.
§Example
fn some_system(mut query: Query<Ref<A>>) {
for a in query.contiguous_iter().unwrap() {
let (a_values, a_ticks) = ContiguousRef::split(a);
for (value, is_added) in a_values.iter().zip(a_ticks.is_added_iter()) {
if is_added {
// do something
}
}
}
}Trait Implementations§
Source§impl<'w> Clone for ContiguousComponentTicksRef<'w>
impl<'w> Clone for ContiguousComponentTicksRef<'w>
Source§fn clone(&self) -> ContiguousComponentTicksRef<'w>
fn clone(&self) -> ContiguousComponentTicksRef<'w>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'w> From<ContiguousComponentTicksMut<'w>> for ContiguousComponentTicksRef<'w>
impl<'w> From<ContiguousComponentTicksMut<'w>> for ContiguousComponentTicksRef<'w>
Source§fn from(
value: ContiguousComponentTicksMut<'w>,
) -> ContiguousComponentTicksRef<'w>
fn from( value: ContiguousComponentTicksMut<'w>, ) -> ContiguousComponentTicksRef<'w>
Auto Trait Implementations§
impl<'w> Freeze for ContiguousComponentTicksRef<'w>
impl<'w> RefUnwindSafe for ContiguousComponentTicksRef<'w>
impl<'w> Send for ContiguousComponentTicksRef<'w>
impl<'w> Sync for ContiguousComponentTicksRef<'w>
impl<'w> Unpin for ContiguousComponentTicksRef<'w>
impl<'w> UnsafeUnpin for ContiguousComponentTicksRef<'w>
impl<'w> UnwindSafe for ContiguousComponentTicksRef<'w>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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