@@ -1636,11 +1636,12 @@ impl<'w, 'q, Q: QueryData, F: QueryFilter> From<&'q mut Query<'w, '_, Q, F>>
1636
1636
1637
1637
/// [System parameter] that provides readonly access to single entity's components, much like [`Query::single`].
1638
1638
///
1639
- /// For meaning behind the generic arguments refer to [`Query`].
1639
+ /// This [`SystemParam`](crate::system::SystemParam) fails validation if zero or more than one matching entity exists.
1640
+ /// This will cause systems that use it to be skipped.
1640
1641
///
1641
- /// When used as a parameter in a system, multiple matching will prevent the system from running .
1642
- /// System skipping will also happen when no matching entity exists, but the behavior can be
1643
- /// handled by using [`Option<QuerySingle> `] instead, which allows zero or one matching entity .
1642
+ /// Use [`Option<QuerySingle<D, F>>`] instead if no matching entities can exist .
1643
+ ///
1644
+ /// See [`Query `] for meaning behind the generic arguments .
1644
1645
pub struct QuerySingle < ' w , D : ReadOnlyQueryData , F : QueryFilter = ( ) > {
1645
1646
pub ( crate ) single : <D :: ReadOnly as WorldQuery >:: Item < ' w > ,
1646
1647
pub ( crate ) _filter : PhantomData < F > ,
@@ -1656,11 +1657,12 @@ impl<'w, D: ReadOnlyQueryData, F: QueryFilter> Deref for QuerySingle<'w, D, F> {
1656
1657
1657
1658
/// [System parameter] that provides mutable access to single entity's components, much like [`Query::single_mut`].
1658
1659
///
1659
- /// For meaning behind the generic arguments refer to [`Query`].
1660
+ /// This [`SystemParam`](crate::system::SystemParam) fails validation if zero or more than one matching entity exists.
1661
+ /// This will cause systems that use it to be skipped.
1662
+ ///
1663
+ /// Use [`Option<QuerySingleMut<D, F>>`] instead if no matching entities can exist.
1660
1664
///
1661
- /// When used as a parameter in a system, multiple matching will prevent the system from running.
1662
- /// System skipping will also happen when no matching entity exists, but the behavior can be
1663
- /// handled by using [`Option<QuerySingleMut>`] instead, which allows zero or one matching entity.
1665
+ /// See [`Query`] for meaning behind the generic arguments.
1664
1666
pub struct QuerySingleMut < ' w , D : QueryData , F : QueryFilter = ( ) > {
1665
1667
pub ( crate ) single : D :: Item < ' w > ,
1666
1668
pub ( crate ) _filter : PhantomData < F > ,
0 commit comments