pub struct SparseSet<T: Component, Track: Tracking = <T as Component>::Tracking> { /* private fields */ }
Expand description
Default component storage.
Implementations
sourceimpl<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.
sourceimpl<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.
sourceimpl<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.
sourceimpl<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.
sourceimpl<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
sourceimpl<T: 'static + Component> Storage for SparseSet<T>
impl<T: 'static + Component> Storage for SparseSet<T>
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, BUCKET_SIZE>>
fn sparse_array(&self) -> Option<&SparseArray<EntityId, BUCKET_SIZE>>
Returns a SparseSet
’s internal SparseArray
. Read more
sourcefn clear_all_removed_or_deleted(&mut self)
fn clear_all_removed_or_deleted(&mut self)
Clear all deletion and removal tracking data.
sourcefn 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
)
Clear all deletion and removal tracking data older than some timestamp.
Auto Trait Implementations
impl<T, Track> RefUnwindSafe for SparseSet<T, Track> where
T: RefUnwindSafe,
Track: RefUnwindSafe,
impl<T, Track> Send for SparseSet<T, Track> where
T: Send,
Track: Send,
impl<T, Track> Sync for SparseSet<T, Track> where
T: Sync,
Track: Sync,
impl<T, Track> Unpin for SparseSet<T, Track> where
T: Unpin,
Track: Unpin,
impl<T, Track> UnwindSafe for SparseSet<T, Track> where
T: UnwindSafe,
Track: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more