Struct bevy_ecs::query::FilteredAccessSet
source · pub struct FilteredAccessSet<T: SparseSetIndex> { /* private fields */ }
Expand description
A collection of FilteredAccess
instances.
Used internally to statically check if systems have conflicting access.
It stores multiple sets of accesses.
- A “combined” set, which is the access of all filters in this set combined.
- The set of access of each individual filters in this set.
Implementations§
source§impl<T: SparseSetIndex> FilteredAccessSet<T>
impl<T: SparseSetIndex> FilteredAccessSet<T>
sourcepub fn combined_access(&self) -> &Access<T>
pub fn combined_access(&self) -> &Access<T>
Returns a reference to the unfiltered access of the entire set.
sourcepub fn is_compatible(&self, other: &FilteredAccessSet<T>) -> bool
pub fn is_compatible(&self, other: &FilteredAccessSet<T>) -> bool
Returns true
if this and other
can be active at the same time.
Access conflict resolution happen in two steps:
- A “coarse” check, if there is no mutual unfiltered conflict between
self
andother
, we already know that the two access sets are compatible. - A “fine grained” check, it kicks in when the “coarse” check fails.
the two access sets might still be compatible if some of the accesses
are restricted with the
With
orWithout
filters so that access is mutually exclusive. The fine grained phase iterates over all filters in theself
set and compares it to all the filters in theother
set, making sure they are all mutually compatible.
sourcepub fn get_conflicts(&self, other: &FilteredAccessSet<T>) -> Vec<T>
pub fn get_conflicts(&self, other: &FilteredAccessSet<T>) -> Vec<T>
Returns a vector of elements that this set and other
cannot access at the same time.
sourcepub fn get_conflicts_single(
&self,
filtered_access: &FilteredAccess<T>
) -> Vec<T>
pub fn get_conflicts_single( &self, filtered_access: &FilteredAccess<T> ) -> Vec<T>
Returns a vector of elements that this set and other
cannot access at the same time.
sourcepub fn add(&mut self, filtered_access: FilteredAccess<T>)
pub fn add(&mut self, filtered_access: FilteredAccess<T>)
Adds the filtered access to the set.
sourcepub fn extend(&mut self, filtered_access_set: FilteredAccessSet<T>)
pub fn extend(&mut self, filtered_access_set: FilteredAccessSet<T>)
Adds all of the accesses from the passed set to self
.
Trait Implementations§
source§impl<T: Clone + SparseSetIndex> Clone for FilteredAccessSet<T>
impl<T: Clone + SparseSetIndex> Clone for FilteredAccessSet<T>
source§fn clone(&self) -> FilteredAccessSet<T>
fn clone(&self) -> FilteredAccessSet<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug + SparseSetIndex> Debug for FilteredAccessSet<T>
impl<T: Debug + SparseSetIndex> Debug for FilteredAccessSet<T>
source§impl<T: SparseSetIndex> Default for FilteredAccessSet<T>
impl<T: SparseSetIndex> Default for FilteredAccessSet<T>
source§impl<T: SparseSetIndex> From<FilteredAccess<T>> for FilteredAccessSet<T>
impl<T: SparseSetIndex> From<FilteredAccess<T>> for FilteredAccessSet<T>
source§fn from(filtered_access: FilteredAccess<T>) -> Self
fn from(filtered_access: FilteredAccess<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for FilteredAccessSet<T>
impl<T> RefUnwindSafe for FilteredAccessSet<T>where
T: RefUnwindSafe,
impl<T> Send for FilteredAccessSet<T>where
T: Send,
impl<T> Sync for FilteredAccessSet<T>where
T: Sync,
impl<T> Unpin for FilteredAccessSet<T>where
T: Unpin,
impl<T> UnwindSafe for FilteredAccessSet<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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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
Creates
Self
using data from the given World
.