pub struct DVec<T>where
T: Deinterleave,{ /* private fields */ }Expand description
Store elements of type T field by field.
A deinterleaved vector stores its value by splitting its components into different arrays to maximize cache friendliness and locality. Dense arrays are used so all elements must have all the fields.
Implementations§
Source§impl<T> DVec<T>where
T: Deinterleave,
impl<T> DVec<T>where
T: Deinterleave,
Sourcepub fn swap_remove(&mut self, i: usize) -> T
pub fn swap_remove(&mut self, i: usize) -> T
Swap remove an element — that is, moving the element at the end of the of the array and decreasing the length.
**Note: this method does not preserve the order. If you need to keep the
element order, use DVec::remove instead.
§Complexity
O(1)
Sourcepub fn get<F>(&self, i: usize) -> Option<&F>where
T: HasField<F>,
pub fn get<F>(&self, i: usize) -> Option<&F>where
T: HasField<F>,
Get element of this type in an array.
Sourcepub fn get_mut<F>(&mut self, i: usize) -> Option<&mut F>where
T: HasField<F>,
pub fn get_mut<F>(&mut self, i: usize) -> Option<&mut F>where
T: HasField<F>,
Get element of this type in an array.
Sourcepub fn iter_proxy(&self) -> T::Iter<'_>
pub fn iter_proxy(&self) -> T::Iter<'_>
Iterate over all fields at once.
You can select which fields to iterate on by dropping the iterators in the result type you don’t need.
Sourcepub fn iter_mut_proxy(&mut self) -> T::IterMut<'_>
pub fn iter_mut_proxy(&mut self) -> T::IterMut<'_>
Iterate over all fields at once.
You can select which fields to iterate on by dropping the iterators in the result type you don’t need.