Storage

Trait Storage 

Source
pub trait Storage: SizedAny {
Show 15 methods // 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_inserted(&mut self, current: TrackingTimestamp) { ... } fn clear_all_modified(&mut self, current: TrackingTimestamp) { ... } 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, ) { ... } fn try_clone(&self, other_current: TrackingTimestamp) -> Option<SBoxBuilder> { ... } fn clone_component_to( &self, other_all_storages: &mut AllStorages, from: EntityId, to: EntityId, other_current: TrackingTimestamp, ) { ... }
}
Expand description

Defines common storage operations.

Provided Methods§

Source

fn any(&self) -> &dyn Any

Casts to &dyn Any.

Source

fn any_mut(&mut self) -> &mut dyn Any

Casts to &mut dyn Any.

Source

fn delete(&mut self, entity: EntityId, current: TrackingTimestamp)

Deletes an entity from this storage.

Source

fn clear(&mut self, current: TrackingTimestamp)

Deletes all components of this storage.

Source

fn memory_usage(&self) -> Option<StorageMemoryUsage>

Returns how much memory this storage uses.

Source

fn name(&self) -> Cow<'static, str>

Returns the storage’s name.

Source

fn sparse_array(&self) -> Option<&SparseArray<EntityId, 32>>

Returns a SparseSet’s internal SparseArray.

Source

fn is_empty(&self) -> bool

Returns true if the storage is empty.

Source

fn clear_all_inserted(&mut self, current: TrackingTimestamp)

Clear all insertion tracking data.

Source

fn clear_all_modified(&mut self, current: TrackingTimestamp)

Clear all modification tracking data.

Source

fn clear_all_removed_and_deleted(&mut self)

Clear all deletion and removal tracking data.

Source

fn clear_all_removed_and_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )

Clear all deletion and removal tracking data older than some timestamp.

Source

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.

Source

fn try_clone(&self, other_current: TrackingTimestamp) -> Option<SBoxBuilder>

Attempts to clone the entire storage.

Source

fn clone_component_to( &self, other_all_storages: &mut AllStorages, from: EntityId, to: EntityId, other_current: TrackingTimestamp, )

Clones a component from a World to another.

Implementors§

Source§

impl Storage for Entities

Source§

impl<T: Component + Send + Sync> Storage for SparseSet<T>

Source§

impl<T: Component + Send> Storage for NonSync<SparseSet<T>>

Available on crate feature thread_local only.
Source§

impl<T: Component + Sync> Storage for NonSend<SparseSet<T>>

Available on crate feature thread_local only.
Source§

impl<T: Component> Storage for NonSendSync<SparseSet<T>>

Available on crate feature thread_local only.
Source§

impl<T: Unique + Send + Sync> Storage for UniqueStorage<T>

Source§

impl<T: Unique + Send> Storage for NonSync<UniqueStorage<T>>

Available on crate feature thread_local only.
Source§

impl<T: Unique + Sync> Storage for NonSend<UniqueStorage<T>>

Available on crate feature thread_local only.
Source§

impl<T: Unique> Storage for NonSendSync<UniqueStorage<T>>

Available on crate feature thread_local only.