pub trait Storage: SizedAny {
// Provided methods
fn any(&self) -> &dyn Any { ... }
fn any_mut(&mut self) -> &mut dyn Any { ... }
fn delete(&mut self, entity: EntityId, current: TrackingTimestamp) { ... }
fn clear(&mut self, current: TrackingTimestamp) { ... }
fn memory_usage(&self) -> Option<StorageMemoryUsage> { ... }
fn name(&self) -> Cow<'static, str> { ... }
fn sparse_array(&self) -> Option<&SparseArray<EntityId, 32>> { ... }
fn is_empty(&self) -> bool { ... }
fn clear_all_removed_and_deleted(&mut self) { ... }
fn clear_all_removed_and_deleted_older_than_timestamp(
&mut self,
_timestamp: TrackingTimestamp,
) { ... }
fn move_component_from(
&mut self,
other_all_storages: &mut AllStorages,
from: EntityId,
to: EntityId,
current: TrackingTimestamp,
other_current: TrackingTimestamp,
) { ... }
}
Expand description
Defines common storage operations.
Provided Methods§
sourcefn delete(&mut self, entity: EntityId, current: TrackingTimestamp)
fn delete(&mut self, entity: EntityId, current: TrackingTimestamp)
Deletes an entity from this storage.
sourcefn clear(&mut self, current: TrackingTimestamp)
fn clear(&mut self, current: TrackingTimestamp)
Deletes all components of this storage.
sourcefn memory_usage(&self) -> Option<StorageMemoryUsage>
fn memory_usage(&self) -> Option<StorageMemoryUsage>
Returns how much memory this storage uses.
sourcefn sparse_array(&self) -> Option<&SparseArray<EntityId, 32>>
fn sparse_array(&self) -> Option<&SparseArray<EntityId, 32>>
Returns a SparseSet
’s internal SparseArray
.
sourcefn clear_all_removed_and_deleted(&mut self)
fn clear_all_removed_and_deleted(&mut self)
Clear all deletion and removal tracking data.
sourcefn clear_all_removed_and_deleted_older_than_timestamp(
&mut self,
_timestamp: TrackingTimestamp,
)
fn clear_all_removed_and_deleted_older_than_timestamp( &mut self, _timestamp: TrackingTimestamp, )
Clear all deletion and removal tracking data older than some timestamp.
sourcefn move_component_from(
&mut self,
other_all_storages: &mut AllStorages,
from: EntityId,
to: EntityId,
current: TrackingTimestamp,
other_current: TrackingTimestamp,
)
fn move_component_from( &mut self, other_all_storages: &mut AllStorages, from: EntityId, to: EntityId, current: TrackingTimestamp, other_current: TrackingTimestamp, )
Moves a component from a World
to another.