You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ fn show_tooltips(
121
121
```
122
122
123
123
Alternatively, if you expect to only have component implementing the trait for each entity,
124
-
you can use the filter [`One`]. This has significantly better performance than iterating
124
+
you can use the filter [`One`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/one/struct.One.html). This has significantly better performance than iterating
125
125
over all trait impls.
126
126
127
127
```rust
@@ -139,10 +139,10 @@ fn show_tooltips(
139
139
140
140
Trait queries support basic change detection filtration.
141
141
142
-
- queries requesting shared access yield [`ReadTraits`] which is similar to
143
-
[`bevy_ecs::change_detection::Ref`]
144
-
- queries requesting exclusive access yield [`WriteTraits`] which is similar to
145
-
[`bevy_ecs::change_detection::Mut`]
142
+
- queries requesting shared access yield [`ReadTraits`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/all/struct.ReadTraits.html) which is
143
+
similar to [`Ref`](https://docs.rs/bevy/latest/bevy/ecs/change_detection/struct.Ref.html)
144
+
- queries requesting exclusive access yield [`WriteTraits`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/all/struct.WriteTraits.html) which is
145
+
similar to [`Mut`](https://docs.rs/bevy/latest/bevy/ecs/change_detection/struct.Mut.html)
146
146
147
147
To get all the components that implement the target trait, and have also changed in some way
148
148
since the last tick, you can:
@@ -162,12 +162,12 @@ fn show_tooltips(
162
162
}
163
163
```
164
164
165
-
Similar to [`iter_changed`](ReadTraits::iter_changed), we have [`iter_added`](ReadTraits::iter_added)
165
+
Similar to [`iter_changed`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/all/struct.ReadTraits.html), we have [`iter_added`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/all/struct.ReadTraits.html)
166
166
to detect entities which have had a trait-implementing component added since the last tick.
167
167
168
168
If you know you have only one component that implements the target trait,
169
-
you can use `OneAdded` or `OneChanged` which behave more like the typical
170
-
`bevy``Added/Changed` filters:
169
+
you can use [`OneAdded`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/one/struct.OneAdded.html) or [`OneChanged`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/one/struct.OneChanged.html) which behave more like the typical
Note in the above example how `OneChanged` does *not* take a reference to the trait object!
182
+
Note in the above example how [`OneChanged`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/one/struct.OneChanged.html) does *not* take a reference to the trait object!
183
183
184
184
### Performance
185
185
186
186
The performance of trait queries is quite competitive. Here are some benchmarks for simple cases:
187
187
188
-
|| Concrete type |`One<dyn Trait>`|`All<dyn Trait>`|
188
+
|| Concrete type |[`One<dyn Trait>`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/one/struct.One.html)|[`All<dyn Trait>`](https://docs.rs/bevy-trait-query/latest/bevy_trait_query/all/struct.All.html)|
0 commit comments