[−][src]Struct soa_vec::Soa2
Struct of arrays storage with vec API. See module docs for more information.
Methods
impl<T1: Sized, T2: Sized> Soa2<T1, T2>
[src]
pub fn new() -> Soa2<T1, T2>
[src]
Creates a new Soa with a capacity of 0
pub fn len(&self) -> usize
[src]
Returns the number of tuples in the soa, also referred to as its 'length'.
pub fn clear(&mut self)
[src]
Clears the soa, removing all values. Note that this method has no effect on the allocated capacity of the soa.
pub fn push(&mut self, value: (T1, T2))
[src]
Appends a tuple to the back of a soa.
pub fn pop(&mut self) -> Option<(T1, T2)>
[src]
Removes the last tuple from a soa and returns it, or None if it is empty.
pub fn swap_remove(&mut self, index: usize) -> (T1, T2)
[src]
Removes a tuple from the soa and returns it. The removed tuple is replaced by the last tuple of the soa. This does not preserve ordering, but is O(1).
Panics:
- Must panic if index is out of bounds
pub fn slices<'a>(&self) -> (&'a [T1], &'a [T2])
[src]
Returns a tuple of all the destructured tuples added to this soa.
pub fn iters<'a>(&self) -> (Iter<'a, T1>, Iter<'a, T2>)
[src]
Returns a tuple of iterators over each field in the soa.
pub fn iters_mut<'a>(&mut self) -> (IterMut<'a, T1>, IterMut<'a, T2>)
[src]
Returns a tuple of mutable iterators over each field in the soa.
pub fn slices_mut<'a>(&self) -> (&'a mut [T1], &'a mut [T2])
[src]
Returns a tuple of all the destructured mutable tuples added to this soa.
pub fn get<'a>(&self, index: usize) -> (&'a T1, &'a T2)
[src]
This is analogous to the index operator in vec, but returns a tuple of references.
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
)
Sorts the soa keeping related data together.
Trait Implementations
impl<T1: Sized, T2: Sized> Default for Soa2<T1, T2>
[src]
impl<T1: Clone + Sized, T2: Clone + Sized> Clone for Soa2<T1, T2>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T1: Sized, T2: Sized> Drop for Soa2<T1, T2>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
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, 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,