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>) -> AccessConflicts
pub fn get_conflicts(&self, other: &FilteredAccessSet<T>) -> AccessConflicts
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>,
) -> AccessConflicts
pub fn get_conflicts_single( &self, filtered_access: &FilteredAccess<T>, ) -> AccessConflicts
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 add_unfiltered_resource_read(&mut self, index: T)
pub fn add_unfiltered_resource_read(&mut self, index: T)
Adds a read access to a resource to the set.
Sourcepub fn add_unfiltered_resource_write(&mut self, index: T)
pub fn add_unfiltered_resource_write(&mut self, index: T)
Adds a write access to a resource to the set.
Sourcepub fn add_unfiltered_read_all_resources(&mut self)
pub fn add_unfiltered_read_all_resources(&mut self)
Adds read access to all resources to the set.
Sourcepub fn add_unfiltered_write_all_resources(&mut self)
pub fn add_unfiltered_write_all_resources(&mut self)
Adds write access to all resources 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: SparseSetIndex> Clone for FilteredAccessSet<T>
impl<T: SparseSetIndex> Clone for FilteredAccessSet<T>
Source§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
Source§impl<T: PartialEq + SparseSetIndex> PartialEq for FilteredAccessSet<T>
impl<T: PartialEq + SparseSetIndex> PartialEq for FilteredAccessSet<T>
impl<T: Eq + SparseSetIndex> Eq for FilteredAccessSet<T>
impl<T: SparseSetIndex> StructuralPartialEq for FilteredAccessSet<T>
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
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>
, which can then be
downcast
into Box<dyn 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>
, which 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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 default()
.