Struct bevy_ecs::query::ChangeTrackers [−][src]
pub struct ChangeTrackers<T: Component> { /* fields omitted */ }
Expand description
WorldQuery
that tracks changes and additions for component T
.
Wraps a Component
to track whether the component changed for the corresponding entities in
a query since the last time the system that includes these queries ran.
If you only care about entities that changed or that got added use the
Changed
and Added
filters instead.
Examples
fn print_moving_objects_system(query: Query<(&Name, ChangeTrackers<Transform>)>) {
for (name, tracker) in query.iter() {
if tracker.is_changed() {
println!("Entity moved: {:?}", name);
} else {
println!("Entity stood still: {:?}", name);
}
}
}
Implementations
Trait Implementations
type Fetch = ChangeTrackersFetch<T>
type State = ChangeTrackersState<T>
type ReadOnlyFetch = ChangeTrackersFetch<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for ChangeTrackers<T> where
T: RefUnwindSafe,
impl<T> Send for ChangeTrackers<T>
impl<T> Sync for ChangeTrackers<T>
impl<T> Unpin for ChangeTrackers<T> where
T: Unpin,
impl<T> UnwindSafe for ChangeTrackers<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more