Skip to main content

EntityHashSet

Type Alias EntityHashSet 

Source
pub type EntityHashSet = EntityEquivalentHashSet<Entity>;
Expand description

An HashSet pre-configured to use EntityHash hashing with an Entity.

Aliased Type§

pub struct EntityHashSet(/* private fields */);

Trait Implementations§

Source§

impl RelationshipSourceCollection for EntityHashSet

Source§

type SourceIter<'a> = Copied<Iter<'a, Entity>>

The type of iterator returned by the iter method. Read more
Source§

fn new() -> Self

Creates a new empty instance.
Source§

fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional more entities to be inserted. Read more
Source§

fn with_capacity(capacity: usize) -> Self

Returns an instance with the given pre-allocated entity capacity. Read more
Source§

fn add(&mut self, entity: Entity) -> bool

Adds the given entity to the collection. Read more
Source§

fn remove(&mut self, entity: Entity) -> bool

Removes the given entity from the collection. Read more
Source§

fn iter(&self) -> Self::SourceIter<'_>

Iterates all entities in the collection.
Source§

fn len(&self) -> usize

Returns the current length of the collection.
Source§

fn clear(&mut self)

Clears the collection.
Source§

fn shrink_to_fit(&mut self)

Attempts to save memory by shrinking the capacity to fit the current length. Read more
Source§

fn extend_from_iter(&mut self, entities: impl IntoIterator<Item = Entity>)

Add multiple entities to collection at once. Read more
Source§

fn is_empty(&self) -> bool

Returns true if the collection contains no entities.
Source§

fn source_to_remove_before_add(&self) -> Option<Entity>

For one-to-one relationships, returns the entity that should be removed before adding a new one. Returns None for one-to-many relationships or when no entity needs to be removed.
Source§

impl WorldEntityFetch for &EntityHashSet

Source§

type Ref<'w> = EntityEquivalentHashMap<Entity, EntityRef<'w>>

The read-only reference type returned by WorldEntityFetch::fetch_ref.
Source§

type Mut<'w> = EntityEquivalentHashMap<Entity, EntityMut<'w>>

The mutable reference type returned by WorldEntityFetch::fetch_mut.
Source§

type DeferredMut<'w> = EntityEquivalentHashMap<Entity, EntityMut<'w>>

The mutable reference type returned by WorldEntityFetch::fetch_deferred_mut, but without structural mutability.
Source§

unsafe fn fetch_ref( self, cell: UnsafeWorldCell<'_>, ) -> Result<Self::Ref<'_>, EntityNotSpawnedError>

Returns read-only reference(s) to the entities with the given Entity IDs, as determined by self. Read more
Source§

unsafe fn fetch_mut( self, cell: UnsafeWorldCell<'_>, ) -> Result<Self::Mut<'_>, EntityMutableFetchError>

Returns mutable reference(s) to the entities with the given Entity IDs, as determined by self. Read more
Source§

unsafe fn fetch_deferred_mut( self, cell: UnsafeWorldCell<'_>, ) -> Result<Self::DeferredMut<'_>, EntityMutableFetchError>

Returns mutable reference(s) to the entities with the given Entity IDs, as determined by self, but without structural mutability. Read more