pub struct FilteredAccess<T>where
T: SparseSetIndex,{ /* private fields */ }Expand description
An Access that has been filtered to include and exclude certain combinations of elements.
Used internally to statically check if queries are disjoint.
Subtle: a read or write in access should not be considered to imply a
with access.
For example consider Query<Option<&T>> this only has a read of T as doing
otherwise would allow for queries to be considered disjoint when they shouldn’t:
Query<(&mut T, Option<&U>)>read/writeT, readU, withUQuery<&mut T, Without<U>>read/writeT, withoutUfrom this we could reasonably conclude that the queries are disjoint but they aren’t.
In order to solve this the actual access that Query<(&mut T, Option<&U>)> has
is read/write T, read U. It must still have a read U access otherwise the following
queries would be incorrectly considered disjoint:
Query<&mut T>read/writeTQuery<Option<&T>accesses nothing
See comments the WorldQuery impls of AnyOf/Option/Or for more information.
Implementations§
Source§impl<T> FilteredAccess<T>where
T: SparseSetIndex,
impl<T> FilteredAccess<T>where
T: SparseSetIndex,
Sourcepub fn access_mut(&mut self) -> &mut Access<T>
pub fn access_mut(&mut self) -> &mut Access<T>
Returns a mutable reference to the underlying unfiltered access.
Sourcepub fn add_with(&mut self, index: T)
pub fn add_with(&mut self, index: T)
Retains only combinations where the element given by index is also present.
Sourcepub fn add_without(&mut self, index: T)
pub fn add_without(&mut self, index: T)
Retains only combinations where the element given by index is not present.
pub fn extend_intersect_filter(&mut self, other: &FilteredAccess<T>)
pub fn extend_access(&mut self, other: &FilteredAccess<T>)
Sourcepub fn is_compatible(&self, other: &FilteredAccess<T>) -> bool
pub fn is_compatible(&self, other: &FilteredAccess<T>) -> bool
Returns true if this and other can be active at the same time.
Sourcepub fn get_conflicts(&self, other: &FilteredAccess<T>) -> Vec<T>
pub fn get_conflicts(&self, other: &FilteredAccess<T>) -> Vec<T>
Returns a vector of elements that this and other cannot access at the same time.
Sourcepub fn extend(&mut self, access: &FilteredAccess<T>)
pub fn extend(&mut self, access: &FilteredAccess<T>)
Adds all access and filters from other.
Trait Implementations§
Source§impl<T> Clone for FilteredAccess<T>where
T: Clone + SparseSetIndex,
impl<T> Clone for FilteredAccess<T>where
T: Clone + SparseSetIndex,
Source§fn clone(&self) -> FilteredAccess<T>
fn clone(&self) -> FilteredAccess<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T> Debug for FilteredAccess<T>where
T: SparseSetIndex + Debug,
impl<T> Debug for FilteredAccess<T>where
T: SparseSetIndex + Debug,
Source§impl<T> Default for FilteredAccess<T>where
T: SparseSetIndex,
impl<T> Default for FilteredAccess<T>where
T: SparseSetIndex,
Source§fn default() -> FilteredAccess<T>
fn default() -> FilteredAccess<T>
Source§impl<T> From<FilteredAccess<T>> for FilteredAccessSet<T>where
T: SparseSetIndex,
impl<T> From<FilteredAccess<T>> for FilteredAccessSet<T>where
T: SparseSetIndex,
Source§fn from(filtered_access: FilteredAccess<T>) -> FilteredAccessSet<T>
fn from(filtered_access: FilteredAccess<T>) -> FilteredAccessSet<T>
Source§impl<T> PartialEq for FilteredAccess<T>where
T: PartialEq + SparseSetIndex,
impl<T> PartialEq for FilteredAccess<T>where
T: PartialEq + SparseSetIndex,
Source§fn eq(&self, other: &FilteredAccess<T>) -> bool
fn eq(&self, other: &FilteredAccess<T>) -> bool
self and other values to be equal, and is used by ==.impl<T> Eq for FilteredAccess<T>where
T: Eq + SparseSetIndex,
impl<T> StructuralPartialEq for FilteredAccess<T>where
T: SparseSetIndex,
Auto Trait Implementations§
impl<T> Freeze for FilteredAccess<T>
impl<T> RefUnwindSafe for FilteredAccess<T>where
T: RefUnwindSafe,
impl<T> Send for FilteredAccess<T>where
T: Send,
impl<T> Sync for FilteredAccess<T>where
T: Sync,
impl<T> Unpin for FilteredAccess<T>where
T: Unpin,
impl<T> UnsafeUnpin for FilteredAccess<T>
impl<T> UnwindSafe for FilteredAccess<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self using data from the given World