Skip to content

Commit 36a9888

Browse files
authored
Merge pull request #65 from RobWalt/add-readme-links
Fix readme links
2 parents decde1d + 514f30b commit 36a9888

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn show_tooltips(
121121
```
122122

123123
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
125125
over all trait impls.
126126

127127
```rust
@@ -139,10 +139,10 @@ fn show_tooltips(
139139

140140
Trait queries support basic change detection filtration.
141141

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)
146146

147147
To get all the components that implement the target trait, and have also changed in some way
148148
since the last tick, you can:
@@ -162,12 +162,12 @@ fn show_tooltips(
162162
}
163163
```
164164

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)
166166
to detect entities which have had a trait-implementing component added since the last tick.
167167

168168
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
170+
`bevy` [`Added`](https://docs.rs/bevy/latest/bevy/ecs/query/struct.Added.html)/[`Changed`](https://docs.rs/bevy/latest/bevy/ecs/query/struct.Changed.html) filters:
171171
```rust
172172
fn show_tooltips(
173173
tooltips_query: Query<One<&dyn Tooltip>, OneChanged<dyn Tooltip>>
@@ -179,13 +179,13 @@ fn show_tooltips(
179179
}
180180
}
181181
```
182-
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!
183183

184184
### Performance
185185

186186
The performance of trait queries is quite competitive. Here are some benchmarks for simple cases:
187187

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) |
189189
|-------------------|----------------|---------------------|-------------------|
190190
| 1 match | 8.395 µs | 28.174 µs | 81.027 µs |
191191
| 2 matches | 8.473 µs | - | 106.47 µs |

bevy-trait-query/src/lib.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
//! ```
162162
//!
163163
//! Alternatively, if you expect to only have component implementing the trait for each entity,
164-
//! you can use the filter [`One`]. This has significantly better performance than iterating
164+
//! you can use the filter [`One`](crate::one::One). This has significantly better performance than iterating
165165
//! over all trait impls.
166166
//!
167167
//! ```
@@ -188,10 +188,10 @@
188188
//!
189189
//! Trait queries support basic change detection filtration.
190190
//!
191-
//! - queries requesting shared access yield [`ReadTraits`] which is similar to
192-
//! [`bevy_ecs::change_detection::Ref`]
193-
//! - queries requesting exclusive access yield [`WriteTraits`] which is similar to
194-
//! [`bevy_ecs::change_detection::Mut`]
191+
//! - queries requesting shared access yield [`ReadTraits`](`crate::all::ReadTraits`) which is
192+
//! similar to [`Ref`](https://docs.rs/bevy/latest/bevy/ecs/change_detection/struct.Ref.html)
193+
//! - queries requesting exclusive access yield [`WriteTraits`](`crate::all::WriteTraits`) which is
194+
//! similar to [`Mut`](https://docs.rs/bevy/latest/bevy/ecs/change_detection/struct.Mut.html)
195195
//!
196196
//! To get all the components that implement the target trait, and have also changed in some way
197197
//! since the last tick, you can:
@@ -219,12 +219,12 @@
219219
//! }
220220
//! ```
221221
//!
222-
//! Similar to [`iter_changed`](ReadTraits::iter_changed), we have [`iter_added`](ReadTraits::iter_added)
222+
//! Similar to [`iter_changed`](crate::all::ReadTraits), we have [`iter_added`](crate::all::ReadTraits)
223223
//! to detect entities which have had a trait-implementing component added since the last tick.
224224
//!
225225
//! If you know you have only one component that implements the target trait,
226-
//! you can use `OneAdded` or `OneChanged` which behave more like the typical
227-
//! `bevy` `Added/Changed` filters:
226+
//! you can use [`OneAdded`](crate::one::OneAdded) or [`OneChanged`](crate::one::OneChanged) which behave more like the typical
227+
//! `bevy` [`Added`](https://docs.rs/bevy/latest/bevy/ecs/query/struct.Added.html)/[`Changed`](https://docs.rs/bevy/latest/bevy/ecs/query/struct.Changed.html) filters:
228228
//! ```no_run
229229
//! # use bevy::prelude::*;
230230
//! # use bevy_trait_query::*;
@@ -244,13 +244,13 @@
244244
//! }
245245
//! }
246246
//! ```
247-
//! Note in the above example how `OneChanged` does *not* take a reference to the trait object!
247+
//! Note in the above example how [`OneChanged`](crate::one::OneChanged) does *not* take a reference to the trait object!
248248
//!
249249
//! # Performance
250250
//!
251251
//! The performance of trait queries is quite competitive. Here are some benchmarks for simple cases:
252252
//!
253-
//! | | Concrete type | `One<dyn Trait>` | `All<dyn Trait>` |
253+
//! | | Concrete type | [`One<dyn Trait>`](crate::one::One) | [`All<dyn Trait>`](crate::all::All) |
254254
//! |-------------------|----------------|---------------------|-------------------|
255255
//! | 1 match | 8.395 µs | 28.174 µs | 81.027 µs |
256256
//! | 2 matches | 8.473 µs | - | 106.47 µs |

0 commit comments

Comments
 (0)