We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ee4195 commit a5ea38fCopy full SHA for a5ea38f
crates/bevy_ecs/src/query/access.rs
@@ -115,6 +115,18 @@ impl<T: SparseSetIndex> Access<T> {
115
.map(SparseSetIndex::get_sparse_set_index)
116
.collect()
117
}
118
+
119
+ /// Returns all read accesses.
120
+ pub fn reads(&self) -> impl Iterator<Item = T> + '_ {
121
+ self.reads_and_writes
122
+ .difference(&self.writes)
123
+ .map(T::get_sparse_set_index)
124
+ }
125
126
+ /// Returns all write accesses.
127
+ pub fn writes(&self) -> impl Iterator<Item = T> + '_ {
128
+ self.writes.ones().map(T::get_sparse_set_index)
129
130
131
132
#[derive(Clone, Eq, PartialEq)]
0 commit comments