pub struct SparseStorage { /* private fields */ }
Implementations§
Source§impl SparseStorage
impl SparseStorage
pub fn new(desc: ComponentDescriptor, capacity: usize) -> Self
pub fn check_change_ticks(&mut self, change_tick: u32)
Trait Implementations§
Source§impl Storage for SparseStorage
impl Storage for SparseStorage
fn get(storage: &ComponentStorage) -> &StorageSets<Self>
fn get_mut(storage: &mut ComponentStorage) -> &mut StorageSets<Self>
Source§impl StorageSet for SparseStorage
impl StorageSet for SparseStorage
Source§fn new(desc: ComponentDescriptor, capacity: usize) -> Self
fn new(desc: ComponentDescriptor, capacity: usize) -> Self
Create a new storage for the given component type
T
.Source§fn contains(&self, entity: Entity) -> bool
fn contains(&self, entity: Entity) -> bool
Returns
true
if the storage contains a component for the given entity.fn entity_ids(&self) -> EntityIdSet
Source§unsafe fn insert(
&mut self,
entity: Entity,
component: *mut u8,
change_tick: u32,
)
unsafe fn insert( &mut self, entity: Entity, component: *mut u8, change_tick: u32, )
Inserts a component for the given entity. Read more
Source§unsafe fn remove_unchecked(&mut self, entity: Entity, component: *mut u8)
unsafe fn remove_unchecked(&mut self, entity: Entity, component: *mut u8)
Removes a component for the given entity. Read more
Source§fn remove_and_drop(&mut self, entity: Entity)
fn remove_and_drop(&mut self, entity: Entity)
Removes a component for the given entity.
Source§unsafe fn get_unchecked(&self, entity: Entity) -> *mut u8
unsafe fn get_unchecked(&self, entity: Entity) -> *mut u8
Returns a pointer to the component for the given entity. Read more
Source§fn get(&self, entity: Entity) -> Option<*mut u8>
fn get(&self, entity: Entity) -> Option<*mut u8>
Returns a pointer to the component for the given entity.
Source§unsafe fn get_ticks_unchecked(&self, entity: Entity) -> &UnsafeCell<ChangeTicks>
unsafe fn get_ticks_unchecked(&self, entity: Entity) -> &UnsafeCell<ChangeTicks>
Returns change ticks for the given entity. Read more
Source§unsafe fn get_with_ticks_unchecked(
&self,
entity: Entity,
) -> (*mut u8, &UnsafeCell<ChangeTicks>)
unsafe fn get_with_ticks_unchecked( &self, entity: Entity, ) -> (*mut u8, &UnsafeCell<ChangeTicks>)
Returns a pointer to the component for the given entity and it’s change ticks. Read more
Auto Trait Implementations§
impl Freeze for SparseStorage
impl !RefUnwindSafe for SparseStorage
impl Send for SparseStorage
impl Sync for SparseStorage
impl Unpin for SparseStorage
impl UnwindSafe for SparseStorage
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
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.