pub struct Column<T> { /* private fields */ }Expand description
Typed dense column for a single component type within one archetype.
Each row has parallel added_ticks and changed_ticks entries for
change detection. Tick 0 is the sentinel meaning “never observed”.
Implementations§
Source§impl<T: Send + Sync + 'static> Column<T>
impl<T: Send + Sync + 'static> Column<T>
Sourcepub fn push_with_ticks(&mut self, value: T, added: u64, changed: u64)
pub fn push_with_ticks(&mut self, value: T, added: u64, changed: u64)
Append a value with explicit tick stamps.
Sourcepub fn swap_remove(&mut self, row: usize) -> T
pub fn swap_remove(&mut self, row: usize) -> T
Swap-remove and return the value at row.
Tick vectors are kept in sync.
Sourcepub fn added_tick(&self, row: usize) -> u64
pub fn added_tick(&self, row: usize) -> u64
The added tick for row (0 = sentinel / never stamped).
Sourcepub fn changed_tick(&self, row: usize) -> u64
pub fn changed_tick(&self, row: usize) -> u64
The changed tick for row (0 = sentinel / never stamped).
Sourcepub fn set_added_tick(&mut self, row: usize, tick: u64)
pub fn set_added_tick(&mut self, row: usize, tick: u64)
Stamp the added tick for row.
Sourcepub fn set_changed_tick(&mut self, row: usize, tick: u64)
pub fn set_changed_tick(&mut self, row: usize, tick: u64)
Stamp the changed tick for row.
Sourcepub fn added_ticks(&self) -> &[u64]
pub fn added_ticks(&self) -> &[u64]
Slice of added ticks (parallel to data rows).
Sourcepub fn changed_ticks(&self) -> &[u64]
pub fn changed_ticks(&self) -> &[u64]
Slice of changed ticks (parallel to data rows).
Trait Implementations§
Source§impl<T: Send + Sync + 'static> AnyColumn for Column<T>
impl<T: Send + Sync + 'static> AnyColumn for Column<T>
Source§fn swap_remove_and_drop(&mut self, row: usize)
fn swap_remove_and_drop(&mut self, row: usize)
Swap-remove a row. The data is dropped.
Source§fn move_to(&mut self, row: usize, dst: &mut dyn AnyColumn)
fn move_to(&mut self, row: usize, dst: &mut dyn AnyColumn)
Move the data at
row in this column into dst (which must be the
same concrete Column<T>). The row is swap-removed from self.Source§fn stamp_ticks(&mut self, row: usize, added: u64, changed: u64)
fn stamp_ticks(&mut self, row: usize, added: u64, changed: u64)
Stamp both tick vectors at
row.fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Auto Trait Implementations§
impl<T> Freeze for Column<T>
impl<T> RefUnwindSafe for Column<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for Column<T>
impl<T> Sync for Column<T>
impl<T> Unpin for Column<T>
impl<T> UnsafeUnpin for Column<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for Column<T>where
Vec<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