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§
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_inserted(&mut self, current: TrackingTimestamp)
fn clear_all_inserted(&mut self, current: TrackingTimestamp)
Clear all insertion tracking data.
Sourcefn clear_all_modified(&mut self, current: TrackingTimestamp)
fn clear_all_modified(&mut self, current: TrackingTimestamp)
Clear all modification tracking data.
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.
Sourcefn try_clone(&self, other_current: TrackingTimestamp) -> Option<SBoxBuilder>
fn try_clone(&self, other_current: TrackingTimestamp) -> Option<SBoxBuilder>
Attempts to clone the entire storage.
Sourcefn clone_component_to(
&self,
other_all_storages: &mut AllStorages,
from: EntityId,
to: EntityId,
other_current: TrackingTimestamp,
)
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§
impl Storage for Entities
impl<T: Component + Send + Sync> Storage for SparseSet<T>
impl<T: Component + Send> Storage for NonSync<SparseSet<T>>
Available on crate feature
thread_local only.impl<T: Component + Sync> Storage for NonSend<SparseSet<T>>
Available on crate feature
thread_local only.impl<T: Component> Storage for NonSendSync<SparseSet<T>>
Available on crate feature
thread_local only.impl<T: Unique + Send + Sync> Storage for UniqueStorage<T>
impl<T: Unique + Send> Storage for NonSync<UniqueStorage<T>>
Available on crate feature
thread_local only.impl<T: Unique + Sync> Storage for NonSend<UniqueStorage<T>>
Available on crate feature
thread_local only.impl<T: Unique> Storage for NonSendSync<UniqueStorage<T>>
Available on crate feature
thread_local only.