[−][src]Struct nano_ecs::MaskStorage
Stores masks efficiently and allows fast iteration.
Fields
masks: Vec<(u64, u64)>
Stores (active, initial)
masks.
offsets: Vec<usize>
Stores the offsets of the mask.
Implementations
impl MaskStorage
[src]
pub fn new() -> MaskStorage
[src]
Creates a new mask storage.
pub fn optimize(&mut self, n: usize) -> Vec<usize>
[src]
Sorts optimally and returns a sort to update entity slices and components.
pub fn next(
&self,
mask_pat: u64,
i: &mut usize,
n: usize
) -> Option<(usize, usize)>
[src]
&self,
mask_pat: u64,
i: &mut usize,
n: usize
) -> Option<(usize, usize)>
Gets the next range of entities with active mask pattern.
pub fn mask_of(&self, cid: usize) -> u64
[src]
Returns the active mask of component id.
pub fn init_mask_of(&self, id: usize) -> u64
[src]
Returns the initial mask of entity id.
pub fn both_masks_of(&self, id: usize) -> (u64, u64)
[src]
Returns both active and initial mask of entity id.
pub fn push(&mut self, mask: u64, id: usize)
[src]
Pushes a new mask.
pub fn update(&mut self, mask: u64, id: usize, n: usize) -> Result<(), usize>
[src]
Updates a mask for an entity, returning Err(swap_id)
to swap components.
Auto Trait Implementations
impl RefUnwindSafe for MaskStorage
impl Send for MaskStorage
impl Sync for MaskStorage
impl Unpin for MaskStorage
impl UnwindSafe for MaskStorage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,