[][src]Struct soa_vec::Soa3

pub struct Soa3<T1: Sized, T2: Sized, T3: Sized> { /* fields omitted */ }

Struct of arrays storage with vec API. See module docs for more information.

Methods

impl<T1: Sized, T2: Sized, T3: Sized> Soa3<T1, T2, T3>[src]

pub fn new() -> Soa3<T1, T2, T3>[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, T3))[src]

Appends a tuple to the back of a soa.

pub fn pop(&mut self) -> Option<(T1, T2, T3)>[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, T3)[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], &'a [T3])[src]

Returns a tuple of all the destructured tuples added to this soa.

pub fn iters<'a>(&self) -> (Iter<'a, T1>, Iter<'a, T2>, Iter<'a, T3>)[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>, IterMut<'a, T3>)
[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], &'a mut [T3])[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, &'a T3)[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, &T3), (&T1, &T2, &T3)) -> Ordering>(
    &mut self,
    f: F
)
[src]

Sorts the soa keeping related data together.

Trait Implementations

impl<T1: Sized, T2: Sized, T3: Sized> Default for Soa3<T1, T2, T3>[src]

impl<T1: Clone + Sized, T2: Clone + Sized, T3: Clone + Sized> Clone for Soa3<T1, T2, T3>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T1: Sized, T2: Sized, T3: Sized> Drop for Soa3<T1, T2, T3>[src]

Auto Trait Implementations

impl<T1, T2, T3> !Send for Soa3<T1, T2, T3>

impl<T1, T2, T3> !Sync for Soa3<T1, T2, T3>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]