Why can't I use two mutually exclusive Query at the same time. #4805
-
What problem or need does this solve?I have two instances of the same type, with children under each instance, I need to use let mut parent_query=paramSet.p0();
let mut children_query=paramSet.p1();
for (children) in parent_query.iter_mut(){
if let OK (chilrenProps) in children_query.get_mut(children[0])
} Why can't I use two mutually exclusive queries at the same time, this is unreasonable. To distinguish Entity such as ParentEntity childrenEntity type, we cannot guarantee that ordinary queries are mutually exclusive, but Parent and children may guarantee that these two are mutually exclusive queries. ##What alternatives have you considered? Additional solutions to address and/or address the issues raised. additional contextany other information you would like to add, such as relevant prior work, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Can you show the type signature of your system? Parents are commonly children themselves, in a nested hierarchy, so there's no guarantee that we're accessing distinct entities here. A more general solution likely involves #3742, but for now, I would probably recommend using |
Beta Was this translation helpful? Give feedback.
Can you show the type signature of your system? Parents are commonly children themselves, in a nested hierarchy, so there's no guarantee that we're accessing distinct entities here.
A more general solution likely involves #3742, but for now, I would probably recommend using
Query::get_many_mut
.