pub struct SparseSet<T: Component, Track: Tracking = <T as Component>::Tracking> { /* private fields */ }
Expand description
Default component storage.
Implementations§
source§impl<T: Component> SparseSet<T>
impl<T: Component> SparseSet<T>
sourcepub fn index_of(&self, entity: EntityId) -> Option<usize>
pub fn index_of(&self, entity: EntityId) -> Option<usize>
Returns the index of entity
’s component in the dense
and data
vectors.
This index is only valid for this storage and until a modification happens.
sourcepub unsafe fn index_of_unchecked(&self, entity: EntityId) -> usize
pub unsafe fn index_of_unchecked(&self, entity: EntityId) -> usize
Returns the index of entity
’s component in the dense
and data
vectors.
This index is only valid for this storage and until a modification happens.
§Safety
entity
has to own a component of this type.
The index is only valid until a modification occurs in the storage.
source§impl<T: Component<Tracking = Deletion>> SparseSet<T, Deletion>
impl<T: Component<Tracking = Deletion>> SparseSet<T, Deletion>
sourcepub fn clear_all_deleted(&mut self)
pub fn clear_all_deleted(&mut self)
Clear all deletion tracking data.
sourcepub fn clear_all_deleted_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all deletion tracking data older than some timestamp.
sourcepub fn clear_all_removed_or_deleted(&mut self)
pub fn clear_all_removed_or_deleted(&mut self)
Clear all deletion and removal tracking data.
sourcepub fn clear_all_removed_or_deleted_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_removed_or_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all deletion and removal tracking data older than some timestamp.
source§impl<T: Component<Tracking = Removal>> SparseSet<T, Removal>
impl<T: Component<Tracking = Removal>> SparseSet<T, Removal>
sourcepub fn clear_all_removed(&mut self)
pub fn clear_all_removed(&mut self)
Clear all removal tracking data.
sourcepub fn clear_all_removed_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_removed_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all removal tracking data older than some timestamp.
sourcepub fn clear_all_removed_and_deleted(&mut self)
pub fn clear_all_removed_and_deleted(&mut self)
Clear all deletion and removal tracking data.
sourcepub fn clear_all_removed_or_deleted_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_removed_or_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all deletion and removal tracking data older than some timestamp.
source§impl<T: Component<Tracking = All>> SparseSet<T, All>
impl<T: Component<Tracking = All>> SparseSet<T, All>
sourcepub fn clear_all_deleted(&mut self)
pub fn clear_all_deleted(&mut self)
Clear all deletion tracking data.
sourcepub fn clear_all_deleted_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all deletion tracking data older than some timestamp.
sourcepub fn clear_all_removed(&mut self)
pub fn clear_all_removed(&mut self)
Clear all removal tracking data.
sourcepub fn clear_all_removed_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_removed_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all removal tracking data older than some timestamp.
sourcepub fn clear_all_removed_and_deleted(&mut self)
pub fn clear_all_removed_and_deleted(&mut self)
Clear all deletion and removal tracking data.
sourcepub fn clear_all_removed_or_deleted_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
pub fn clear_all_removed_or_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Clear all deletion and removal tracking data older than some timestamp.
source§impl<T: Component> SparseSet<T>
impl<T: Component> SparseSet<T>
sourcepub fn is_tracking_insertion(&self) -> bool
pub fn is_tracking_insertion(&self) -> bool
Returns true
if the storage tracks insertion.
sourcepub fn is_tracking_modification(&self) -> bool
pub fn is_tracking_modification(&self) -> bool
Returns true
if the storage tracks modification.
sourcepub fn is_tracking_deletion(&self) -> bool
pub fn is_tracking_deletion(&self) -> bool
Returns true
if the storage tracks deletion.
sourcepub fn is_tracking_removal(&self) -> bool
pub fn is_tracking_removal(&self) -> bool
Returns true
if the storage tracks removal.
sourcepub fn is_tracking_any(&self) -> bool
pub fn is_tracking_any(&self) -> bool
Returns true
if the storage tracks insertion, modification, deletion or removal.
Trait Implementations§
source§impl<T: 'static + Component> Storage for SparseSet<T>
impl<T: 'static + Component> Storage for SparseSet<T>
source§fn memory_usage(&self) -> Option<StorageMemoryUsage>
fn memory_usage(&self) -> Option<StorageMemoryUsage>
source§fn sparse_array(&self) -> Option<&SparseArray<EntityId, BUCKET_SIZE>>
fn sparse_array(&self) -> Option<&SparseArray<EntityId, BUCKET_SIZE>>
SparseSet
’s internal SparseArray
.source§fn clear_all_removed_or_deleted(&mut self)
fn clear_all_removed_or_deleted(&mut self)
source§fn clear_all_removed_or_deleted_older_than_timestamp(
&mut self,
timestamp: TrackingTimestamp,
)
fn clear_all_removed_or_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )
Auto Trait Implementations§
impl<T, Track> Freeze for SparseSet<T, Track>
impl<T, Track> RefUnwindSafe for SparseSet<T, Track>where
Track: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Track> Send for SparseSet<T, Track>where
T: Send,
impl<T, Track> Sync for SparseSet<T, Track>where
T: Sync,
impl<T, Track> Unpin for SparseSet<T, Track>
impl<T, Track> UnwindSafe for SparseSet<T, Track>where
Track: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> TupleDeleteAny for Twhere
T: 'static + Storage + CustomDeleteAny,
impl<T> TupleDeleteAny for Twhere
T: 'static + Storage + CustomDeleteAny,
source§fn delete_any(all_storages: &mut AllStorages)
fn delete_any(all_storages: &mut AllStorages)
source§impl<S> TupleRetain for Swhere
S: 'static + Storage,
impl<S> TupleRetain for Swhere
S: 'static + Storage,
source§fn retain(all_storages: &mut AllStorages, entity: EntityId)
fn retain(all_storages: &mut AllStorages, entity: EntityId)
World::retain
and AllStorages::retain
.