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: u32) { ... }
    fn clear(&mut self, _current: u32) { ... }
    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_or_deleted(&mut self) { ... }
    fn clear_all_removed_or_deleted_older_than_timestamp(
        &mut self,
        _timestamp: 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: u32)

Deletes an entity from this storage.

source

fn clear(&mut self, _current: u32)

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_or_deleted(&mut self)

Clear all deletion and removal tracking data.

source

fn clear_all_removed_or_deleted_older_than_timestamp( &mut self, _timestamp: TrackingTimestamp, )

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

Implementors§