pub struct FilteredAccessSet { /* 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 FilteredAccessSet
impl FilteredAccessSet
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates an empty FilteredAccessSet.
Sourcepub fn combined_access(&self) -> &Access
pub fn combined_access(&self) -> &Access
Returns a reference to the unfiltered access of the entire set.
Sourcepub fn is_compatible(&self, other: &FilteredAccessSet) -> bool
pub fn is_compatible(&self, other: &FilteredAccessSet) -> 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
selfandother, 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
WithorWithoutfilters so that access is mutually exclusive. The fine grained phase iterates over all filters in theselfset and compares it to all the filters in theotherset, making sure they are all mutually compatible.
Sourcepub fn get_conflicts(&self, other: &FilteredAccessSet) -> AccessConflicts
pub fn get_conflicts(&self, other: &FilteredAccessSet) -> 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,
) -> AccessConflicts
pub fn get_conflicts_single( &self, filtered_access: &FilteredAccess, ) -> 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)
pub fn add(&mut self, filtered_access: FilteredAccess)
Adds the filtered access to the set.
Sourcepub fn add_unfiltered_resource_read(&mut self, index: ComponentId)
pub fn add_unfiltered_resource_read(&mut self, index: ComponentId)
Adds a read access to a resource to the set.
Sourcepub fn add_unfiltered_resource_write(&mut self, index: ComponentId)
pub fn add_unfiltered_resource_write(&mut self, index: ComponentId)
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)
pub fn extend(&mut self, filtered_access_set: FilteredAccessSet)
Adds all of the accesses from the passed set to self.
Trait Implementations§
Source§impl Clone for FilteredAccessSet
impl Clone for FilteredAccessSet
Source§impl Debug for FilteredAccessSet
impl Debug for FilteredAccessSet
Source§impl Default for FilteredAccessSet
impl Default for FilteredAccessSet
Source§fn default() -> FilteredAccessSet
fn default() -> FilteredAccessSet
Source§impl From<FilteredAccess> for FilteredAccessSet
impl From<FilteredAccess> for FilteredAccessSet
Source§fn from(filtered_access: FilteredAccess) -> Self
fn from(filtered_access: FilteredAccess) -> Self
Source§impl PartialEq for FilteredAccessSet
impl PartialEq for FilteredAccessSet
impl Eq for FilteredAccessSet
impl StructuralPartialEq for FilteredAccessSet
Auto Trait Implementations§
impl Freeze for FilteredAccessSet
impl RefUnwindSafe for FilteredAccessSet
impl Send for FilteredAccessSet
impl Sync for FilteredAccessSet
impl Unpin for FilteredAccessSet
impl UnwindSafe for FilteredAccessSet
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<T> DowncastSync for T
impl<T> DowncastSync 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().