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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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
.