Trait shipyard::Storage

source ·
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§

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_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.

Implementors§

source§

impl Storage for Entities

source§

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

source§

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

source§

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

source§

impl<T: 'static + Component> Storage for NonSendSync<SparseSet<T>>

source§

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