pub struct Column<T: 'static> {
cells: Vec<UnsafeCell<T>>,
}Expand description
One component type’s values inside one archetype.
Each value sits in its own cell, so a query may hold the components of two entities at once. A row’s cell index is the row number and never changes while the row exists.
Fields§
§cells: Vec<UnsafeCell<T>>Implementations§
Source§impl<T: 'static> Column<T>
impl<T: 'static> Column<T>
Sourcepub(crate) fn eraser() -> fn() -> Box<dyn AnyColumn>
pub(crate) fn eraser() -> fn() -> Box<dyn AnyColumn>
A function that builds an empty column of this component type.
Sourcepub(crate) fn cells(&self) -> &[UnsafeCell<T>]
pub(crate) fn cells(&self) -> &[UnsafeCell<T>]
Every cell of the column, one per row.
Handing out the slice is safe; taking the value out of a cell needs the
claim the caller took on the column. See crate::borrow.
Sourcepub(crate) fn cells_mut(&mut self) -> &mut [UnsafeCell<T>]
pub(crate) fn cells_mut(&mut self) -> &mut [UnsafeCell<T>]
Every cell of the column, reached exclusively.
Trait Implementations§
Source§impl<T: 'static> AnyColumn for Column<T>
impl<T: 'static> AnyColumn for Column<T>
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Downcast support for a column reached exclusively.
Source§fn swap_remove(&mut self, row: usize) -> Box<dyn Any>
fn swap_remove(&mut self, row: usize) -> Box<dyn Any>
Move the value at
row out, filling the hole with the last value.Source§fn push_boxed(&mut self, value: Box<dyn Any>)
fn push_boxed(&mut self, value: Box<dyn Any>)
Append an already erased value of this column’s component type.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Column<T>
impl<T> !Sync for Column<T>
impl<T> Forget for Column<T>
impl<T> Freeze for Column<T>
impl<T> Send for Column<T>
impl<T> Unpin for Column<T>
impl<T> UnsafeUnpin for Column<T>
impl<T> UnwindSafe for Column<T>
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