Given two world queries
Either<T, U> provides a world query that contains
T’s item or the
U’s item. If both
successfully match an entity, then only
T’s item is given, e.g. there isn’t a
EitherBoth<T, U> does allow one to match
T’s item or
U’s item. What sets it apart is
Both(t, u) variant, allowing both
U’s items to be
provided, given that they do both match.
This macro creates a new world query enum with a new variant for each of its possible matched
world queries. There isn’t a “both”/“multiple” variant and the priority is always given to the
first declared variant when multiple matches occur. This lets you create world queries similar
Either, matching over one of the variant world queries with some priority order.
either_many!, you can put
readonly before the name of the new
query. This will make the resulting type’s fetcher
read only. The type is read only if and only if all of its
variants are read only, and this is an invariant you must uphold.