[−][src]Struct soa_vec::Soa2
Stores slices in a struct-of-arrays style with the API of Vec. The advantage over simply using multiple Vec is that all slices live in a single allocation, there's one shared len/capacity variable, and the API ensures that items are kept together through all operations like push/pop/sort
Methods
impl<T1: Sized, T2: Sized> Soa2<T1, T2>[src]
pub fn new() -> Soa2<T1, T2>[src]
pub fn len(&self) -> usize[src]
pub fn clear(&mut self)[src]
pub fn push(&mut self, value: (T1, T2))[src]
pub fn pop(&mut self) -> Option<(T1, T2)>[src]
pub fn swap_remove(&mut self, index: usize) -> (T1, T2)[src]
##Panics:
- Must panic if index is out of bounds
pub fn slices<'a>(&self) -> (&'a [T1], &'a [T2])[src]
pub fn iters<'a>(&self) -> (Iter<'a, T1>, Iter<'a, T2>)[src]
pub fn slices_mut<'a>(&self) -> (&'a mut [T1], &'a mut [T2])[src]
pub fn get<'a>(&self, index: usize) -> (&'a T1, &'a T2)[src]
Panics
- If index is >= len
pub fn sort_unstable_by<F: FnMut((&T1, &T2), (&T1, &T2)) -> Ordering>(
&mut self,
f: F
)[src]
&mut self,
f: F
)
Trait Implementations
impl<T1: Sized, T2: Sized> Drop for Soa2<T1, T2>[src]
impl<T1: Clone + Sized, T2: Clone + Sized> Clone for Soa2<T1, T2>[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,