Skip to main content

EntityIndexSet

Type Alias EntityIndexSet 

Source
pub type EntityIndexSet = EntityEquivalentIndexSet<Entity>;
Expand description

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

Aliased Type§

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

Trait Implementations§

Source§

impl MapEntities for EntityIndexSet

Source§

fn map_entities<E: EntityMapper>(&mut self, entity_mapper: &mut E)

Updates all Entity references stored inside using entity_mapper. Read more
Source§

impl RelationshipSourceCollection for EntityIndexSet

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.