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],
summary_tick: Option<&'w AtomicTick>,
last_run: Tick,
this_run: Tick,
caller: MaybeLocation<&'w [&'static Location<'static>]>,
) -> Option<Self>
pub fn new( added: &'w [Tick], changed: &'w [Tick], summary_tick: Option<&'w AtomicTick>, last_run: Tick, this_run: Tick, caller: MaybeLocation<&'w [&'static Location<'static>]>, ) -> Option<Self>
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
}
}
}
}Sourcepub fn slice(self, range: Range<u32>) -> Self
pub fn slice(self, range: Range<u32>) -> Self
Narrows the range of rows that this set of ticks represents.
If the range is out of range, this method will panic.
Sourcepub fn summary_tick_is_changed(&self) -> Option<bool>
pub fn summary_tick_is_changed(&self) -> Option<bool>
Returns Some(true) if this component has a summary tick and any
component in this column may have been changed since the last time the
associated query ran.
If the component has no summary tick, this method returns None. If
there is a summary tick, but there has been no change since the last
time the query ran, this method returns Some(false).
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 (const: unstable) · 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>) -> Self
fn from(value: ContiguousComponentTicksMut<'w>) -> Self
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,
impl<T> ConditionalSend for Twhere
T: Send,
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> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.