pub struct BasicVecStorage<T>(/* private fields */);
Expand description
ComponentStorage
that is just Vec<Option<T>>
.
Trait Implementations§
Source§impl<'a, T> ComponentStorage<'a> for BasicVecStorage<T>where
T: 'a,
impl<'a, T> ComponentStorage<'a> for BasicVecStorage<T>where
T: 'a,
Source§type Iter = Map<Iter<'a, Option<UnsafeCell<T>>>, fn(&'a Option<UnsafeCell<T>>) -> Option<&'a T>>
type Iter = Map<Iter<'a, Option<UnsafeCell<T>>>, fn(&'a Option<UnsafeCell<T>>) -> Option<&'a T>>
Immutable iterator type.
Source§fn get<'b>(&'b self, entity: Entity) -> Option<&'b T>
fn get<'b>(&'b self, entity: Entity) -> Option<&'b T>
Get the component corresponding to the given entity, if it exists.
Source§fn get_raw(&self, entity: Entity) -> *const T
fn get_raw(&self, entity: Entity) -> *const T
Get a raw pointer to the component corresponding to the given entity, if it exists. Must
return
std::ptr::null()
if the component doesn’t exist for the given entity.Source§impl<T: Debug> Debug for BasicVecStorage<T>
impl<T: Debug> Debug for BasicVecStorage<T>
Source§impl<T: Default> Default for BasicVecStorage<T>
impl<T: Default> Default for BasicVecStorage<T>
Source§fn default() -> BasicVecStorage<T>
fn default() -> BasicVecStorage<T>
Returns the “default value” for a type. Read more
Source§impl<'a, T: 'a> MutableComponentStorage<'a> for BasicVecStorage<T>
impl<'a, T: 'a> MutableComponentStorage<'a> for BasicVecStorage<T>
Source§type IterMut = Map<IterMut<'a, Option<UnsafeCell<T>>>, fn(&mut Option<UnsafeCell<T>>) -> Option<&'a mut T>>
type IterMut = Map<IterMut<'a, Option<UnsafeCell<T>>>, fn(&mut Option<UnsafeCell<T>>) -> Option<&'a mut T>>
Mutable iterator type.
Source§fn iter_mut(&'a mut self) -> Self::IterMut
fn iter_mut(&'a mut self) -> Self::IterMut
Mutably iterate over the components in this storage. Read more
Source§fn get_mut<'b>(&'b mut self, entity: Entity) -> Option<&'b mut T>
fn get_mut<'b>(&'b mut self, entity: Entity) -> Option<&'b mut T>
Get a mutable reference to the component corresponding to the given entity, if it exists.
Source§fn get_raw_mut(&mut self, entity: Entity) -> *mut T
fn get_raw_mut(&mut self, entity: Entity) -> *mut T
Get a mutable raw pointer to the component corresponding to the given entity, if it exists.
Must return
std::ptr::null()
if the component doesn’t exist for the given entity.Auto Trait Implementations§
impl<T> Freeze for BasicVecStorage<T>
impl<T> !RefUnwindSafe for BasicVecStorage<T>
impl<T> Send for BasicVecStorage<T>where
T: Send,
impl<T> !Sync for BasicVecStorage<T>
impl<T> Unpin for BasicVecStorage<T>where
T: Unpin,
impl<T> UnwindSafe for BasicVecStorage<T>where
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
Mutably borrows from an owned value. Read more